tehkillerbee / mopidy-tidal

Tidal Backend plugin for Mopidy
Apache License 2.0
93 stars 28 forks source link

Always add newly created playlists to cache #98

Closed blacklight closed 1 year ago

blacklight commented 1 year ago

If playlist_cache_refresh_secs is unset then the playlist won't be automatically added to _current_tidal_playlists. We should do it explicitly if we want the backend to be able to immediately get its contents.

tehkillerbee commented 1 year ago

@BlackLight @2e0byo This PR fails all tests; do we need to update the tests as well?

By the way, sorry for not processing this PR sooner.

2e0byo commented 1 year ago

@tehkillerbee I'll get on this shortly.

2e0byo commented 1 year ago

I think there was actually a bug in this PR. We want to add the tidal playlist, not the mopidy playlist, to _current_tidal_playlists. So I think the test suite actually earned its keep.

However once this is fixed we need to fix the test suite, as create() now triggers a refresh(), so we have to mock playlist.tracks (to return nothing, and have a __name__).

The attached patch fixes this. 0001-fix-cache-tidal-playlist-not-mopidy-playlist.txt

blacklight commented 1 year ago

Thanks for the fix @2e0byo!

codecov-commenter commented 1 year ago

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (d6bf226) 100.00% compared to head (3df712d) 100.00%.

:mega: This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #98 +/- ## ========================================= Coverage 100.00% 100.00% ========================================= Files 12 13 +1 Lines 868 896 +28 Branches 168 168 ========================================= + Hits 868 896 +28 ``` | [Impacted Files](https://codecov.io/gh/tehkillerbee/mopidy-tidal/pull/98?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Johannes+L) | Coverage Δ | | |---|---|---| | [mopidy\_tidal/\_\_init\_\_.py](https://codecov.io/gh/tehkillerbee/mopidy-tidal/pull/98?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Johannes+L#diff-bW9waWR5X3RpZGFsL19faW5pdF9fLnB5) | `100.00% <ø> (ø)` | | | [mopidy\_tidal/playlists.py](https://codecov.io/gh/tehkillerbee/mopidy-tidal/pull/98?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Johannes+L#diff-bW9waWR5X3RpZGFsL3BsYXlsaXN0cy5weQ==) | `100.00% <100.00%> (ø)` | | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Johannes+L). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Johannes+L)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.