Navigation Menu

Skip to content

Commit

Permalink
Merge branch 'master' of github.com:Giftie/script.cdartmanager into F…
Browse files Browse the repository at this point in the history
…rodo

Conflicts:
	default.py
	resources/language/English/strings.xml
	resources/lib/database.py
	resources/lib/download.py
	resources/lib/fanarttv_scraper.py
	resources/lib/file_item.py
	resources/lib/gui.py
	resources/lib/jsonrpc_calls.py
	resources/lib/musicbrainz_utils.py
  • Loading branch information
Giftie committed Jan 9, 2013
2 parents c9bdad7 + 5d2b9ea commit 96f1c65
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 11 deletions.
28 changes: 28 additions & 0 deletions default.py
@@ -1,6 +1,10 @@
# -*- coding: utf-8 -*-

<<<<<<< HEAD
import sys, os, traceback, time, datetime, calendar
=======
import sys, os, traceback, socket, time, datetime, calendar
>>>>>>> 5d2b9ea1f78aa6eebfd0cb265e15deb40a3d66d9
import xbmcaddon, xbmc, xbmcgui

try:
Expand Down Expand Up @@ -84,6 +88,12 @@
mb_delay = 1
else:
mb_delay = mb_delay * 100
<<<<<<< HEAD
=======

#time socket out at 30 seconds
socket.setdefaulttimeout(30)
>>>>>>> 5d2b9ea1f78aa6eebfd0cb265e15deb40a3d66d9

sys.path.append( os.path.join( BASE_RESOURCE_PATH, "skins", "Default" ) )
sys.path.append( os.path.join( BASE_RESOURCE_PATH, "lib" ))
Expand Down Expand Up @@ -202,8 +212,17 @@ def update_xbmc_thumbnails( background=False ):
file_rename( artistthumb_rename, artistthumb_path )
if exists( fanart_path ):
xbmc_fanart_path = get_fanart_path( artist["local_id"], "artist" )
<<<<<<< HEAD
elif exists( artistthumb_path ):
xbmc_thumbnail_path = get_thumbnail_path( artist["local_id"], "artist" )
=======
thumb_fanart_path = Thumbnails().get_cached_fanart_thumb( change_characters( artist["name"] ), "artist" )
thumbnail_copy( fanart_path, thumb_fanart_path, "thumbnail" )
elif exists( artistthumb_path ):
xbmc_thumbnail_path = get_thumbnail_path( artist["local_id"], "artist" )
thumb_artist_path = Thumbnails().get_cached_artist_thumb( change_characters( artist["name"] ) )
thumbnail_copy( artistthumb_path, thumb_artist_path, "thumbnail" )
>>>>>>> 5d2b9ea1f78aa6eebfd0cb265e15deb40a3d66d9
else:
continue
if xbmc_fanart_path: # copy to XBMC supplied fanart path
Expand All @@ -225,6 +244,11 @@ def update_xbmc_thumbnails( background=False ):
coverart_path = os.path.join( album["path"], albumthumb ).replace( "\\\\","\\" )
if exists( coverart_path ):
xbmc_thumbnail_path = get_thumbnail_path( album["local_id"], "album" )
<<<<<<< HEAD
=======
thumb_album_path = Thumbnails().get_cached_album_thumb( album["path"] )
thumbnail_copy( coverart_path, thumb_album_path, "thumbnail" )
>>>>>>> 5d2b9ea1f78aa6eebfd0cb265e15deb40a3d66d9
if xbmc_thumbnail_path:
thumbnail_copy( coverart_path, xbmc_thumbnail_path, "album cover" )
count += 1
Expand Down Expand Up @@ -299,7 +323,11 @@ def get_script_mode():
log( "# %-50s #" % __credits__, xbmc.LOGNOTICE )
log( "# %-50s #" % __credits2__, xbmc.LOGNOTICE )
log( "# Thanks for the help guys... #", xbmc.LOGNOTICE )
<<<<<<< HEAD
log( "# %-50s #" % "Frodo", xbmc.LOGNOTICE )
=======
log( "# %-50s #" % "Eden", xbmc.LOGNOTICE )
>>>>>>> 5d2b9ea1f78aa6eebfd0cb265e15deb40a3d66d9
log( "############################################################", xbmc.LOGNOTICE )
log( "Looking for settings.xml", xbmc.LOGNOTICE )
if not exists(settings_file): # Open Settings if settings.xml does not exists
Expand Down
4 changes: 0 additions & 4 deletions resources/lib/database.py
Expand Up @@ -910,10 +910,6 @@ def update_database( background=False ):
for item in album_detail_list:
if not ( item["disc"], get_unicode( item["artist"] ), get_unicode( item["title"] ), item["cover"], item["cdart"], item["local_id"], get_unicode( item["path"] ) ) in matched_indexed:
unmatched.append(item)
print "#### album_detail_list ####"
print album_detail_list
print "#### local_album_list ####"
print local_album_list
unmatched_details = retrieve_album_details_full( unmatched, len( unmatched ), background = background, simple = False, update = True )
combined = matched
combined.extend( unmatched_details )
Expand Down
1 change: 1 addition & 0 deletions resources/lib/download.py
Expand Up @@ -164,6 +164,7 @@ def _report_hook( count, blocksize, totalsize ):
#message = ["Download Sucessful!"]
message = [__language__(32023), __language__(32024), "File: %s" % get_unicode( path ), "Url: %s" % get_unicode( url_cdart )]
success = file_copy( destination, final_destination ) # copy it to album folder
log( "Online Thumbnail Path, can not update: %s" % repr( thumb_path ), xbmc.LOGDEBUG )
# update database
try:
conn = sqlite3.connect(addon_db)
Expand Down
5 changes: 1 addition & 4 deletions resources/lib/fanarttv_scraper.py
Expand Up @@ -220,8 +220,7 @@ def retrieve_fanarttv_json( id ):
albums.append( album_artwork )
except:
print_exc()
fanart["backgrounds"] = backgrounds
clearlogo["clearlogo"] = musiclogos
fanart["backgrounds"] = backgrounds clearlogo["clearlogo"] = musiclogos
hdlogo["hdlogo"] = hdlogos
banner["banner"] = banners
artistthumb["artistthumb"] = artistthumbs
Expand Down Expand Up @@ -404,5 +403,3 @@ def get_recognized( all_artists, album_artists, background=False ):
dialog_msg( "close", background = background )
log( "Finished Getting Recognized Artists", xbmc.LOGDEBUG )
return all_artists_matched, album_artists_matched


5 changes: 2 additions & 3 deletions resources/lib/file_item.py
Expand Up @@ -39,7 +39,7 @@ def get_cached_thumb( self, path1, path2, SPLIT=False ):

def get_cached_artist_thumb( self, strLabel ):
return self.get_cached_thumb( "artist" + strLabel, os.path.join( THUMBS_CACHE_PATH ), True )

def get_cached_profile_thumb( self ):
return xbmc.translatePath( xbmc.getInfoImage( "System.ProfileThumb" ) )

Expand All @@ -54,7 +54,7 @@ def get_cached_picture_thumb( self, strPath ):

def get_cached_album_thumb( self, strPath ):
return self.get_cached_thumb( strPath, os.path.join( THUMBS_CACHE_PATH ), True )

def get_cached_video_thumb( self, strPath ):
if strPath.startswith( "stack://" ):
strPath = strPath[ 8 : ].split( " , " )[ 0 ]
Expand All @@ -66,7 +66,6 @@ def get_cached_episode_thumb( self, strPath, iEpisode=0 ):

def get_cached_fanart_thumb( self, strPath, fanart="" ):
return self.get_cached_thumb( strPath, os.path.join( THUMBS_CACHE_PATH ), True )

def get_cached_program_thumb( self, strPath ):
return self.get_cached_thumb( strPath, os.path.join( THUMBS_CACHE_PATH, "Programs" ) )

Expand Down

0 comments on commit 96f1c65

Please sign in to comment.