Merge branch 'jellyfin:master' into master

This commit is contained in:
GregoireDruant 2023-08-27 16:32:53 +02:00 committed by GitHub
commit aa7bc89f2e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 284 additions and 45 deletions

View file

@ -150,8 +150,8 @@ class Kodi(object):
bulk_updates.setdefault(sql, []).append((person_id,) + args)
elif person['Type'] == 'Artist':
sql = QU.update_link.replace("{LinkType}", 'actor_link')
bulk_updates.setdefault(sql, []).append((person_id,) + args)
sql = QU.insert_link_if_not_exists.replace("{LinkType}", 'actor_link')
bulk_updates.setdefault(sql, []).append((person_id,) + args + (person_id,) + args)
add_thumbnail(person_id, person, person['Type'])

View file

@ -402,6 +402,13 @@ update_link = """
INSERT OR REPLACE INTO {LinkType}(actor_id, media_id, media_type)
VALUES (?, ?, ?)
"""
# update_link does not work for actor_link as not all values from unique index are provided
# Resulting in duplicates
insert_link_if_not_exists = """
INSERT INTO {LinkType}(actor_id, media_id, media_type)
SELECT ?, ?, ?
WHERE NOT EXISTS(SELECT 1 FROM {LinkType} WHERE actor_id = ? AND media_id = ? AND media_type = ?)
"""
update_movie = """
UPDATE movie
SET c00 = ?, c01 = ?, c02 = ?, c03 = ?, c04 = ?, c05 = ?, c06 = ?,

View file

@ -291,8 +291,7 @@ class Music(KodiDb):
if obj['DatePlayed']:
obj['DatePlayed'] = Local(obj['DatePlayed']).split('.')[0].replace('T', " ")
if obj['Disc'] != 1:
obj['Index'] = obj['Disc'] * 2 ** 16 + obj['Index']
obj['Index'] = obj['Disc'] * 2 ** 16 + obj['Index']
if update:
self.song_update(obj)

View file

@ -86,8 +86,6 @@ class MusicVideos(KodiDb):
obj['Year'] = int(str(obj['Year'])[:4])
obj['Path'] = API.get_file_path(obj['Path'])
obj['LibraryId'] = self.library['Id']
obj['LibraryName'] = self.library['Name']
obj['Genres'] = obj['Genres'] or []
obj['ArtistItems'] = obj['ArtistItems'] or []
obj['Studios'] = [API.validate_studio(studio) for studio in (obj['Studios'] or [])]