mirror of
https://github.com/krateng/maloja.git
synced 2023-08-10 21:12:55 +03:00
Added option to show album art for tracks
This commit is contained in:
parent
9443ad2f62
commit
501984d04e
@ -134,6 +134,14 @@ resolve_semaphore = BoundedSemaphore(8)
|
|||||||
|
|
||||||
def resolve_track_image(track_id):
|
def resolve_track_image(track_id):
|
||||||
|
|
||||||
|
if malojaconfig["USE_ALBUM_ARTWORK_FOR_TRACKS"]:
|
||||||
|
track = database.sqldb.get_track(track_id)
|
||||||
|
if "album" in track:
|
||||||
|
album_id = database.sqldb.get_album_id(track["album"])
|
||||||
|
albumart = resolve_album_image(album_id)
|
||||||
|
if albumart:
|
||||||
|
return albumart
|
||||||
|
|
||||||
with resolve_semaphore:
|
with resolve_semaphore:
|
||||||
# check cache
|
# check cache
|
||||||
result = get_image_from_cache(track_id,'tracks')
|
result = get_image_from_cache(track_id,'tracks')
|
||||||
|
@ -196,6 +196,7 @@ malojaconfig = Configuration(
|
|||||||
"album_showcase":(tp.Boolean(), "Display Album Showcase", True, "Display a graphical album showcase for artist overview pages instead of a chart list"),
|
"album_showcase":(tp.Boolean(), "Display Album Showcase", True, "Display a graphical album showcase for artist overview pages instead of a chart list"),
|
||||||
"display_art_icons":(tp.Boolean(), "Display Album/Artist Icons", True),
|
"display_art_icons":(tp.Boolean(), "Display Album/Artist Icons", True),
|
||||||
"default_album_artist":(tp.String(), "Default Albumartist", "Various Artists"),
|
"default_album_artist":(tp.String(), "Default Albumartist", "Various Artists"),
|
||||||
|
"use_album_artwork_for_tracks":(tp.Boolean(), "Use Album Artwork for tracks", True),
|
||||||
"discourage_cpu_heavy_stats":(tp.Boolean(), "Discourage CPU-heavy stats", False, "Prevent visitors from mindlessly clicking on CPU-heavy options. Does not actually disable them for malicious actors!"),
|
"discourage_cpu_heavy_stats":(tp.Boolean(), "Discourage CPU-heavy stats", False, "Prevent visitors from mindlessly clicking on CPU-heavy options. Does not actually disable them for malicious actors!"),
|
||||||
"use_local_images":(tp.Boolean(), "Use Local Images", True),
|
"use_local_images":(tp.Boolean(), "Use Local Images", True),
|
||||||
#"local_image_rotate":(tp.Integer(), "Local Image Rotate", 3600),
|
#"local_image_rotate":(tp.Integer(), "Local Image Rotate", 3600),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user