Update code

This commit is contained in:
2024-05-16 10:57:24 +08:00
parent 4f133e976d
commit f6582be3f0
7 changed files with 382 additions and 76 deletions

View File

@@ -97,6 +97,19 @@ class LibraryDb:
cur.row_factory = sqlite3.Row
return [dict(i) for i in cur.fetchall()]
def get_albums(self, album: str = None, albumArtists: str = None):
args = ['MediaBrowser.Controller.Entities.Audio.MusicAlbum']
where_sql = ''
if album is not None:
where_sql += ' AND Name = ?'
args.append(album)
if albumArtists is not None:
where_sql += ' AND AlbumArtists = ?'
args.append(albumArtists)
cur = self._db.execute(f"SELECT * FROM TypedBaseItems WHERE type = ?{where_sql};", args) # noqa: E501
cur.row_factory = sqlite3.Row
return [dict(i) for i in cur.fetchall()]
class JellyfinDb:
def __init__(self, fn: str):