Skip to content

Commit

Permalink
fix error in sync data how to
Browse files Browse the repository at this point in the history
  • Loading branch information
geo-martino committed Apr 25, 2024
1 parent 47349f3 commit e300741
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
5 changes: 3 additions & 2 deletions docs/_howto/scripts/sync.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from musify.libraries.remote.spotify.api import SpotifyAPI
from musify.processors.match import ItemMatcher
api = SpotifyAPI()

from musify.libraries.local.library import LocalLibrary
Expand All @@ -19,10 +20,10 @@
albums = local_library.albums[:3]
factory = SpotifyObjectFactory(api=api)

searcher = RemoteItemSearcher(object_factory=factory)
searcher = RemoteItemSearcher(matcher=ItemMatcher(), object_factory=factory)
searcher.search(albums)

checker = RemoteItemChecker(object_factory=factory)
checker = RemoteItemChecker(matcher=ItemMatcher(), object_factory=factory)
checker.check(albums)

from musify.libraries.remote.spotify.object import SpotifyTrack
Expand Down
8 changes: 4 additions & 4 deletions docs/howto.sync.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Sync data

.. literalinclude:: _howto/scripts/sync.py
:language: Python
:lines: 4-13
:lines: 5-14

.. literalinclude:: _howto/scripts/spotify.api.py
:language: Python
Expand All @@ -31,7 +31,7 @@ Sync data

.. literalinclude:: _howto/scripts/sync.py
:language: Python
:lines: 15-26
:lines: 16-27

3. Load the matched tracks, get tags from the music streaming service, and save the tags to the file:

Expand All @@ -40,10 +40,10 @@ Sync data

.. literalinclude:: _howto/scripts/sync.py
:language: Python
:lines: 28-47
:lines: 29-48

4. Once all tracks in a playlist have URIs assigned, sync the local playlist with a remote playlist:

.. literalinclude:: _howto/scripts/sync.py
:language: Python
:lines: 49-59
:lines: 50-60
5 changes: 5 additions & 0 deletions docs/release-history.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ Changed

* :py:class:`.FilterComparers` now accepts a single :py:class:`.Comparer` on the ``comparers`` argument.

Documentation
-------------

* Fixed error in 'sync data' how-to

0.9.1
=====

Expand Down

0 comments on commit e300741

Please sign in to comment.