mirror of
https://github.com/sanderfoobar/ircradio.git
synced 2024-11-21 19:39:42 +01:00
fix thumbnails
This commit is contained in:
parent
9cff22f6ac
commit
1f04b1e9d5
@ -2,6 +2,7 @@
|
|||||||
# Copyright (c) 2021, dsc@xmr.pm
|
# Copyright (c) 2021, dsc@xmr.pm
|
||||||
|
|
||||||
import os, re, dataclasses, random
|
import os, re, dataclasses, random
|
||||||
|
from glob import glob
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from typing import Tuple, Optional
|
from typing import Tuple, Optional
|
||||||
from quart import request, render_template, abort, jsonify, send_from_directory, current_app, websocket, redirect, session, url_for
|
from quart import request, render_template, abort, jsonify, send_from_directory, current_app, websocket, redirect, session, url_for
|
||||||
@ -319,9 +320,10 @@ async def ws():
|
|||||||
async def assets_art(path: str):
|
async def assets_art(path: str):
|
||||||
img_default = "album_art_default.jpg"
|
img_default = "album_art_default.jpg"
|
||||||
_base = os.path.join(settings.cwd, "ircradio", "static")
|
_base = os.path.join(settings.cwd, "ircradio", "static")
|
||||||
|
mix_dirs = glob(settings.dir_mixes + "/*")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
for _dirname in [settings.dir_meta, settings.dir_music]:
|
for _dirname in [settings.dir_meta, settings.dir_music, *mix_dirs]:
|
||||||
_path = os.path.join(_dirname, path)
|
_path = os.path.join(_dirname, path)
|
||||||
if os.path.exists(_path):
|
if os.path.exists(_path):
|
||||||
return await send_from_directory(_dirname, path)
|
return await send_from_directory(_dirname, path)
|
||||||
|
@ -19,6 +19,8 @@ redis_uri = os.environ.get('REDIS_URI', 'redis://localhost:6379')
|
|||||||
|
|
||||||
dir_music = os.environ.get("DIR_MUSIC", os.path.join(cwd, "data", "music"))
|
dir_music = os.environ.get("DIR_MUSIC", os.path.join(cwd, "data", "music"))
|
||||||
dir_meta = os.environ.get("DIR_MUSIC", os.path.join(cwd, "data", "music_metadata"))
|
dir_meta = os.environ.get("DIR_MUSIC", os.path.join(cwd, "data", "music_metadata"))
|
||||||
|
dir_mixes = "/home/radio/mixes/"
|
||||||
|
|
||||||
if not os.path.exists(dir_music):
|
if not os.path.exists(dir_music):
|
||||||
os.mkdir(dir_music)
|
os.mkdir(dir_music)
|
||||||
if not os.path.exists(dir_meta):
|
if not os.path.exists(dir_meta):
|
||||||
|
Loading…
Reference in New Issue
Block a user