mirror of
https://github.com/rembo10/headphones.git
synced 2026-07-22 08:53:59 +01:00
Added a timeout to last.fm album art calls from the post processor
This commit is contained in:
@@ -13,6 +13,7 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with Headphones. If not, see <http://www.gnu.org/licenses/>.
|
# along with Headphones. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
import urllib2
|
||||||
from headphones import db
|
from headphones import db
|
||||||
|
|
||||||
def getAlbumArt(albumid):
|
def getAlbumArt(albumid):
|
||||||
@@ -36,7 +37,7 @@ def getCachedArt(albumid):
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
if artwork_path.startswith('http://'):
|
if artwork_path.startswith('http://'):
|
||||||
artwork = urllib.urlopen(artwork_path).read()
|
artwork = urllib2.urlopen(artwork_path, timeout=20).read()
|
||||||
return artwork
|
return artwork
|
||||||
else:
|
else:
|
||||||
artwork = open(artwork_path, "r").read()
|
artwork = open(artwork_path, "r").read()
|
||||||
|
|||||||
Reference in New Issue
Block a user