mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-12-25 02:06:09 +00:00
Adjust music video premiere
This commit is contained in:
parent
e2a183a08b
commit
9a50392d0c
2 changed files with 36 additions and 4 deletions
|
@ -50,6 +50,19 @@ class KodiMusicVideos(KodiItems):
|
||||||
)
|
)
|
||||||
self.cursor.execute(query, (args))
|
self.cursor.execute(query, (args))
|
||||||
|
|
||||||
|
def add_musicvideo_16(self, *args):
|
||||||
|
|
||||||
|
query = (
|
||||||
|
'''
|
||||||
|
INSERT INTO musicvideo(
|
||||||
|
idMVideo, idFile, c00, c04, c05, c06, c07, c08, c09, c10, c11, c12)
|
||||||
|
|
||||||
|
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
||||||
|
'''
|
||||||
|
)
|
||||||
|
self.cursor.execute(query, (args))
|
||||||
|
|
||||||
|
|
||||||
def update_musicvideo(self, *args):
|
def update_musicvideo(self, *args):
|
||||||
|
|
||||||
query = ' '.join((
|
query = ' '.join((
|
||||||
|
@ -61,6 +74,17 @@ class KodiMusicVideos(KodiItems):
|
||||||
))
|
))
|
||||||
self.cursor.execute(query, (args))
|
self.cursor.execute(query, (args))
|
||||||
|
|
||||||
|
def update_musicvideo_16(self, *args):
|
||||||
|
|
||||||
|
query = ' '.join((
|
||||||
|
|
||||||
|
"UPDATE musicvideo",
|
||||||
|
"SET c00 = ?, c04 = ?, c05 = ?, c06 = ?, c07 = ?, c08 = ?, c09 = ?, c10 = ?,",
|
||||||
|
"c11 = ?, c12 = ?"
|
||||||
|
"WHERE idMVideo = ?"
|
||||||
|
))
|
||||||
|
self.cursor.execute(query, (args))
|
||||||
|
|
||||||
def remove_musicvideo(self, kodi_id, file_id):
|
def remove_musicvideo(self, kodi_id, file_id):
|
||||||
self.cursor.execute("DELETE FROM musicvideo WHERE idMVideo = ?", (kodi_id,))
|
self.cursor.execute("DELETE FROM musicvideo WHERE idMVideo = ?", (kodi_id,))
|
||||||
self.cursor.execute("DELETE FROM files WHERE idFile = ?", (file_id,))
|
self.cursor.execute("DELETE FROM files WHERE idFile = ?", (file_id,))
|
||||||
|
|
|
@ -193,8 +193,12 @@ class MusicVideos(Items):
|
||||||
log.info("UPDATE mvideo itemid: %s - Title: %s", itemid, title)
|
log.info("UPDATE mvideo itemid: %s - Title: %s", itemid, title)
|
||||||
|
|
||||||
# Update the music video entry
|
# Update the music video entry
|
||||||
self.kodi_db.update_musicvideo(title, runtime, director, studio, year, plot, album,
|
if self.kodi_version > 16: #Krypton and later
|
||||||
artist, genre, track, premiered, mvideoid)
|
self.kodi_db.update_musicvideo(title, runtime, director, studio, year, plot, album,
|
||||||
|
artist, genre, track, premiered, mvideoid)
|
||||||
|
else:
|
||||||
|
self.kodi_db.update_musicvideo_16(title, runtime, director, studio, year, plot, album,
|
||||||
|
artist, genre, track, mvideoid)
|
||||||
|
|
||||||
# Update the checksum in emby table
|
# Update the checksum in emby table
|
||||||
emby_db.updateReference(itemid, checksum)
|
emby_db.updateReference(itemid, checksum)
|
||||||
|
@ -209,8 +213,12 @@ class MusicVideos(Items):
|
||||||
fileid = self.kodi_db.add_file(filename, pathid)
|
fileid = self.kodi_db.add_file(filename, pathid)
|
||||||
|
|
||||||
# Create the musicvideo entry
|
# Create the musicvideo entry
|
||||||
self.kodi_db.add_musicvideo(mvideoid, fileid, title, runtime, director, studio,
|
if self.kodi_version > 16: #Krypton and later
|
||||||
year, plot, album, artist, genre, track, premiered)
|
self.kodi_db.add_musicvideo(mvideoid, fileid, title, runtime, director, studio,
|
||||||
|
year, plot, album, artist, genre, track, premiered)
|
||||||
|
else:
|
||||||
|
self.kodi_db.add_musicvideo_16(mvideoid, fileid, title, runtime, director, studio,
|
||||||
|
year, plot, album, artist, genre, track)
|
||||||
|
|
||||||
# Create the reference in emby table
|
# Create the reference in emby table
|
||||||
emby_db.addReference(itemid, mvideoid, "MusicVideo", "musicvideo", fileid, pathid,
|
emby_db.addReference(itemid, mvideoid, "MusicVideo", "musicvideo", fileid, pathid,
|
||||||
|
|
Loading…
Reference in a new issue