From 06fe6d258991dfd30c25b7fa112eabbf51f78146 Mon Sep 17 00:00:00 2001 From: Johan Hjorth Date: Wed, 25 Jun 2025 12:31:23 +0000 Subject: [PATCH] non-working solution --- lastfm_helpers.py | 11 ++++++----- plex_playlist_sync.py | 16 +++++++++------- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/lastfm_helpers.py b/lastfm_helpers.py index e5188b5..6021f29 100644 --- a/lastfm_helpers.py +++ b/lastfm_helpers.py @@ -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 [] \ No newline at end of file + return [] diff --git a/plex_playlist_sync.py b/plex_playlist_sync.py index fa6afc9..0a93dc4 100644 --- a/plex_playlist_sync.py +++ b/plex_playlist_sync.py @@ -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() \ No newline at end of file + create_lastfm_recommended_playlist()