Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.1.3-rc #66

Merged
merged 19 commits into from
Sep 2, 2024
Merged

2.1.3-rc #66

merged 19 commits into from
Sep 2, 2024

Conversation

Gyarbij
Copy link
Owner

@Gyarbij Gyarbij commented Sep 2, 2024

  • Refactor plex.py to fix cache initialization
  • Refactor plexist.py to persist cache
  • Refactor plex.py to improve caching
  • Added tenacity for implementing retry logic.
  • Update requirements.txt to include tenacity library
  • Refactor plex.py for improved matching and logging
  • remove: global match threshold in favor of type match threshold
  • Update SECURITY.md to include supported versions and reporting instructions
  • Update docker-compose.yml filename to compose.yaml, update file contents and update readme.
  • refine match scoring
  • Update plex.py: Use the DB_PATH environment variable, with a default fallback.

Gyarbij added 19 commits August 31, 2024 15:11
Use the DB_PATH environment variable, with a default fallback
…fallback.

New match func that, starts with a strict matching criteria, including title, artist, and album.
If no match is found, it relaxes the album requirement and searches again.
If still no match, it uses only the first two words of the title (if available) along with the artist.
It uses a scoring system that weights title, artist, and album differently.
It also checks for version information in parentheses and factors that into the score.
The thresholds for accepting a match are different at each stage, becoming more lenient as we progress.
It provides more detailed logging about why a match was accepted at a particular stage.

Changed the initial check from if tracks is None to if not tracks. This will handle both None and empty lists.
Moved the plex.playlist(playlist.name) call inside the try block. This ensures we're not trying to access a playlist that doesn't exist.
Improved error handling by catching specific exceptions and logging the error messages.
Added more detailed logging, including success messages for updating description and poster.
Changed some logging.info calls to logging.error or logging.warning where appropriate.
Simplified the logic for handling missing tracks CSV files.
Ensured consistent use of string formatting in logging calls.
- Implemented a caching mechanism using a global dictionary plex_tracks_cache to store all Plex tracks.

- Added function fetch_all_plex_tracks that fetches all tracks from Plex and caches them, function uses @Retry decorator to handle temporary network issues.

- Modified _get_available_plex_tracks to use the cached tracks instead of performing multiple searches.

- Updated _match_single_track to work with the cached tracks instead of performing Plex searches.

- Added retry mechanisms to _update_plex_playlist and update_or_create_plex_playlist functions.

- Added a clear_cache function to clear the cache when needed (e.g., between runs or when you want to force a refresh).
Copy link

New dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
pypi/[email protected] eval, unsafe 0 220 kB jd, sileht

View full report↗︎

@Gyarbij Gyarbij merged commit 662be36 into main Sep 2, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Plexist exits out halfway through first playlist. Cannot write CSV
1 participant