Attempt to increase music db stability
This commit is contained in:
parent
574d2e061e
commit
40c742e71e
2 changed files with 15 additions and 5 deletions
|
@ -1748,6 +1748,8 @@ class Music(Items):
|
||||||
|
|
||||||
# Update artwork
|
# Update artwork
|
||||||
artwork.addArtwork(artworks, artistid, "artist", kodicursor)
|
artwork.addArtwork(artworks, artistid, "artist", kodicursor)
|
||||||
|
self.embyconn.commit()
|
||||||
|
self.kodiconn.commit()
|
||||||
|
|
||||||
def add_updateAlbum(self, item, viewtag=None, viewid=None):
|
def add_updateAlbum(self, item, viewtag=None, viewid=None):
|
||||||
try:
|
try:
|
||||||
|
@ -1947,6 +1949,8 @@ class Music(Items):
|
||||||
kodi_db.addMusicGenres(albumid, genres, "album")
|
kodi_db.addMusicGenres(albumid, genres, "album")
|
||||||
# Update artwork
|
# Update artwork
|
||||||
artwork.addArtwork(artworks, albumid, "album", kodicursor)
|
artwork.addArtwork(artworks, albumid, "album", kodicursor)
|
||||||
|
self.embyconn.commit()
|
||||||
|
self.kodiconn.commit()
|
||||||
|
|
||||||
def add_updateSong(self, item, viewtag=None, viewid=None):
|
def add_updateSong(self, item, viewtag=None, viewid=None):
|
||||||
try:
|
try:
|
||||||
|
@ -2053,12 +2057,12 @@ class Music(Items):
|
||||||
path = "%s%s" % (self.server, item[0][0].attrib.get('key'))
|
path = "%s%s" % (self.server, item[0][0].attrib.get('key'))
|
||||||
filename = API.addPlexCredentialsToUrl(path)
|
filename = API.addPlexCredentialsToUrl(path)
|
||||||
# Keep path empty to not let Kodi scan it
|
# Keep path empty to not let Kodi scan it
|
||||||
path = None
|
path = ""
|
||||||
|
|
||||||
# UPDATE THE SONG #####
|
# UPDATE THE SONG #####
|
||||||
if update_item:
|
if update_item:
|
||||||
self.logMsg("UPDATE song itemid: %s - Title: %s"
|
self.logMsg("UPDATE song itemid: %s - Title: %s with path: %s"
|
||||||
% (itemid, title), 1)
|
% (itemid, title, path), 1)
|
||||||
# Update path
|
# Update path
|
||||||
query = "UPDATE path SET strPath = ? WHERE idPath = ?"
|
query = "UPDATE path SET strPath = ? WHERE idPath = ?"
|
||||||
kodicursor.execute(query, (path, pathid))
|
kodicursor.execute(query, (path, pathid))
|
||||||
|
@ -2282,6 +2286,8 @@ class Music(Items):
|
||||||
if item.get('parentKey') is None:
|
if item.get('parentKey') is None:
|
||||||
# Update album artwork
|
# Update album artwork
|
||||||
artwork.addArtwork(allart, albumid, "album", kodicursor)
|
artwork.addArtwork(allart, albumid, "album", kodicursor)
|
||||||
|
self.embyconn.commit()
|
||||||
|
self.kodiconn.commit()
|
||||||
|
|
||||||
def remove(self, itemid):
|
def remove(self, itemid):
|
||||||
# Remove kodiid, fileid, pathid, emby reference
|
# Remove kodiid, fileid, pathid, emby reference
|
||||||
|
@ -2363,6 +2369,8 @@ class Music(Items):
|
||||||
self.removeArtist(kodiid)
|
self.removeArtist(kodiid)
|
||||||
|
|
||||||
self.logMsg("Deleted %s: %s from kodi database" % (mediatype, itemid), 1)
|
self.logMsg("Deleted %s: %s from kodi database" % (mediatype, itemid), 1)
|
||||||
|
self.embyconn.commit()
|
||||||
|
self.kodiconn.commit()
|
||||||
|
|
||||||
def removeSong(self, kodiid):
|
def removeSong(self, kodiid):
|
||||||
|
|
||||||
|
|
|
@ -48,9 +48,11 @@ class Kodidb_Functions():
|
||||||
self.artwork = artwork.Artwork()
|
self.artwork = artwork.Artwork()
|
||||||
|
|
||||||
def addPath(self, path):
|
def addPath(self, path):
|
||||||
|
# SQL won't return existing paths otherwise
|
||||||
|
self.logMsg('path is: %s' % path, 1)
|
||||||
|
if path is None:
|
||||||
|
path = ""
|
||||||
cursor = self.cursor
|
cursor = self.cursor
|
||||||
|
|
||||||
query = ' '.join((
|
query = ' '.join((
|
||||||
|
|
||||||
"SELECT idPath",
|
"SELECT idPath",
|
||||||
|
|
Loading…
Reference in a new issue