diff --git a/addon.xml b/addon.xml index 4e64da2d..345bdc1f 100644 --- a/addon.xml +++ b/addon.xml @@ -1,7 +1,7 @@ diff --git a/changelog.txt b/changelog.txt index 57c565c2..e2fb89aa 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,7 @@ +version 1.1.81 +- Fix missing deviceId +- Fix to newly added album/songs (if you experienced the bug, you will need to reset to fix it. Know that moving forward, it is corrected.) + version 1.1.80 - Add refresh for video nodes - Fix for home videos (being unable to back out of the menu). Running refresh playlists/nodes will fix this. diff --git a/resources/lib/itemtypes.py b/resources/lib/itemtypes.py index 1bcdaec2..04b92828 100644 --- a/resources/lib/itemtypes.py +++ b/resources/lib/itemtypes.py @@ -1934,39 +1934,50 @@ class Music(Items): self.logMsg("Song itemid: %s has no albumId." % itemid, 1) return except TypeError: - # No album found, create a single's album - kodicursor.execute("select coalesce(max(idAlbum),0) from album") - albumid = kodicursor.fetchone()[0] + 1 - if kodiversion in (16, 17): - # Kodi Jarvis, Krypton - query = ( - ''' - INSERT INTO album(idAlbum, strGenres, iYear, strReleaseType) + # No album found. Let's create it + self.logMsg("Album database entry missing.", 1) + emby_albumId = item['AlbumId'] + album = self.emby.getItem(emby_albumId) + self.add_updateAlbum(album) + emby_dbalbum = emby_db.getItem_byId(emby_albumId) + try: + albumid = emby_dbalbum[0] + self.logMsg("Found albumid: %s" % albumid, 1) + except TypeError: + # No album found, create a single's album + self.logMsg("Failed to add album. Creating singles.", 1) + kodicursor.execute("select coalesce(max(idAlbum),0) from album") + albumid = kodicursor.fetchone()[0] + 1 + if kodiversion == 16: + # Kodi Jarvis + query = ( + ''' + INSERT INTO album(idAlbum, strGenres, iYear, strReleaseType) - VALUES (?, ?, ?, ?) - ''' - ) - kodicursor.execute(query, (albumid, genre, year, "single")) - elif kodiversion == 15: - # Kodi Isengard - query = ( - ''' - INSERT INTO album(idAlbum, strGenres, iYear, dateAdded, strReleaseType) + VALUES (?, ?, ?, ?) + ''' + ) + kodicursor.execute(query, (albumid, genre, year, "single")) + elif kodiversion == 15: + # Kodi Isengard + query = ( + ''' + INSERT INTO album(idAlbum, strGenres, iYear, dateAdded, strReleaseType) - VALUES (?, ?, ?, ?, ?) - ''' - ) - kodicursor.execute(query, (albumid, genre, year, dateadded, "single")) - else: - # Kodi Helix - query = ( - ''' - INSERT INTO album(idAlbum, strGenres, iYear, dateAdded) + VALUES (?, ?, ?, ?, ?) + ''' + ) + kodicursor.execute(query, (albumid, genre, year, dateadded, "single")) + else: + # Kodi Helix + query = ( + ''' + INSERT INTO album(idAlbum, strGenres, iYear, dateAdded) - VALUES (?, ?, ?, ?) - ''' - ) - kodicursor.execute(query, (albumid, genre, year, dateadded)) + VALUES (?, ?, ?, ?) + ''' + ) + kodicursor.execute(query, (albumid, genre, year, dateadded)) # Create the song entry kodicursor.execute("select coalesce(max(idSong),0) from song") diff --git a/resources/lib/playbackutils.py b/resources/lib/playbackutils.py index e99da361..0951a793 100644 --- a/resources/lib/playbackutils.py +++ b/resources/lib/playbackutils.py @@ -258,7 +258,7 @@ class PlaybackUtils(): ############### -- ADD MAIN ITEM ONLY FOR HOMESCREEN ############### - if homeScreen and not sizePlaylist: + if homeScreen and not seektime and not sizePlaylist: # Extend our current playlist with the actual item to play # only if there's no playlist first self.logMsg("Adding main item to playlist.", 1) diff --git a/resources/lib/playutils.py b/resources/lib/playutils.py index 8cf11589..6cb2f29e 100644 --- a/resources/lib/playutils.py +++ b/resources/lib/playutils.py @@ -107,6 +107,15 @@ class PlayUtils(): except (IndexError, KeyError): playurl = item['Path'] + if item.get('VideoType'): + # Specific format modification + type = item['VideoType'] + + if type == "Dvd": + playurl = "%s/VIDEO_TS/VIDEO_TS.IFO" % playurl + elif type == "BluRay": + playurl = "%s/BDMV/index.bdmv" % playurl + # Assign network protocol if playurl.startswith('\\\\'): playurl = playurl.replace("\\\\", "smb://")