non-working solution

This commit is contained in:
Johan Hjorth 2025-06-25 12:31:23 +00:00
parent 88d1f94748
commit 06fe6d2589
2 changed files with 15 additions and 12 deletions

View file

@ -1,10 +1,11 @@
# lastfm_helpers.py
import pylast
from config import (
LASTFM_API_KEY, LASTFM_API_SECRET, LASTFM_USERNAME,
MIN_PLAYS, RECENT_MONTHS
)
#from config import (
# LASTFM_API_KEY, LASTFM_API_SECRET, LASTFM_USERNAME,
# MIN_PLAYS, RECENT_MONTHS
#)
from config import *
import logging
from datetime import datetime, timedelta
from collections import defaultdict
@ -86,4 +87,4 @@ def get_artist_top_tracks(artist_name, limit=5):
return []
except Exception as e:
log.warning(f"Unexpected error fetching top tracks for '{artist_name}': {e}")
return []
return []

View file

@ -1,11 +1,13 @@
# plex_playlist_sync.py
from config import (
LASTFM_API_KEY, LASTFM_API_SECRET, LASTFM_USERNAME,
PLEX_BASEURL, PLEX_TOKEN,
MIN_PLAYS, RECENT_MONTHS, MAX_SIMILAR_PER_ART, SIMILAR_MATCH_MIN,
CACHE_TTL_HOURS, DEBUG_PRINT
)
#from config import (
# LASTFM_API_KEY, LASTFM_API_SECRET, LASTFM_USERNAME,
# PLEX_BASEURL, PLEX_TOKEN,
# MIN_PLAYS, RECENT_MONTHS, MAX_SIMILAR_PER_ART, SIMILAR_MATCH_MIN,
# CACHE_TTL_HOURS, DEBUG_PRINT
#)
from config import *
# Importera relevanta funktioner från lastfm_helpers
from lastfm_helpers import recent_artists, get_artist_top_tracks
from musicbrainz_helpers import load_cache, save_cache # Används för cache
@ -159,4 +161,4 @@ def create_lastfm_recommended_playlist():
log.info(f"🎉 Done! Process took {((time.time()-start_time)/60):.1f} minutes.")
if __name__ == "__main__":
create_lastfm_recommended_playlist()
create_lastfm_recommended_playlist()