Enhance RadioUtil playlist handling and deduplication - Added checks to ensure playlists are initialized and not empty. - Improved deduplication logic to prevent modifying the original playlist during iteration. - Added logging for duplicate removal and playlist population. Add cover art handling in rip_background.py - Implemented functionality to attach album art if provided in metadata. - Added error handling for cover art download failures. Introduce unique filename handling in rip_background.py - Added `ensure_unique_filename_in_dir` function to prevent overwriting files with the same name. Refactor SRUtil for improved error handling and metadata fetching - Introduced `MetadataFetchError` for better error management during metadata retrieval. - Implemented `_safe_api_call` for resilient API calls with retry logic. - Enhanced `get_artists_by_name` to optionally group results by artist name. - Updated various methods to utilize the new error handling and retry mechanisms.
26 lines
891 B
Python
26 lines
891 B
Python
import asyncio
|
|
import logging
|
|
import sys
|
|
sys.path.insert(0, "..")
|
|
from utils.sr_wrapper import SRUtil
|
|
|
|
# logging.getLogger("sr_wrapper").propagate = False
|
|
logger = logging.getLogger()
|
|
logger.setLevel(logging.CRITICAL)
|
|
|
|
async def main():
|
|
sr = SRUtil()
|
|
artist_search = await sr.get_artists_by_name("Ren")
|
|
# logging.critical("Artist search: %s", artist_search)
|
|
res = [dict(x) for x in artist_search if x.get('popularity', 0) and x.get('artist').lower() == 'ren']
|
|
logging.critical("Results: %s", res)
|
|
# search_res = await sr.get_album_by_name(artist[:8], album)
|
|
# logging.critical("Search result: %s", search_res)
|
|
# album = search_res
|
|
# _cover = await sr.get_cover_by_album_id(album.get('id'), 640)
|
|
# # cover = sr._get_tidal_cover_url(album.get('cover'), 640)
|
|
# logging.critical("Result: %s, Cover: %s", album, _cover)
|
|
return
|
|
|
|
|
|
asyncio.run(main()) |