Skip to content

Commit

Permalink
change scopes + more tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
geo-martino committed Jan 6, 2024
1 parent 510b1c6 commit f2c5779
Show file tree
Hide file tree
Showing 68 changed files with 108 additions and 111 deletions.
5 changes: 3 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
from syncify import PROGRAM_NAME
from syncify.config import Config, ConfigLibraryDifferences, ConfigMissingTags, ConfigRemote, ConfigLocal
from syncify.shared.exception import ConfigError
from syncify.local.track.fields import LocalTrackField
from syncify.local.track.field import LocalTrackField
from syncify.local.collection import LocalCollection
from syncify.local.track import LocalTrack, SyncResultTrack
from syncify.processors.base import DynamicProcessor, dynamicprocessormethod
from syncify.shared.remote.api import RemoteAPI
from syncify.shared.remote.enums import RemoteObjectType
from syncify.shared.remote.enum import RemoteObjectType
from syncify.shared.remote.object import RemoteAlbum
from syncify.report import report_playlist_differences, report_missing_tags
from syncify.shared.utils import get_user_input, to_collection
Expand Down Expand Up @@ -760,6 +760,7 @@ def get_parser() -> argparse.ArgumentParser:


## SELECTED FOR DEVELOPMENT
# TODO: fix bug in spotify api test: artist albums have unexpected keys
# TODO: expand readme + check all python functions work
# TODO: implement XAutoPF full update functionality
# TODO: implement merge_playlists functions and, by extension, implement android library sync
Expand Down
4 changes: 2 additions & 2 deletions src/syncify/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@

from syncify import PACKAGE_ROOT, MODULE_ROOT
from syncify.shared.core.base import NamedObject
from syncify.shared.core.enums import TagField
from syncify.shared.core.enum import TagField
from syncify.shared.core.misc import PrettyPrinter, Filter
from syncify.shared.core.object import Library
from syncify.shared.api.authorise import APIAuthoriser
from syncify.shared.api.request import RequestHandler
from syncify.shared.exception import ConfigError, SyncifyError
from syncify.local.track.fields import LocalTrackField
from syncify.local.track.field import LocalTrackField
from syncify.local.collection import LocalCollection
from syncify.local.exception import InvalidFileType, FileDoesNotExistError
from syncify.local.library import MusicBee, LocalLibrary
Expand Down
6 changes: 3 additions & 3 deletions src/syncify/local/collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@

from syncify.shared.core.base import Item
from syncify.shared.core.collection import ItemCollection
from syncify.shared.core.enums import Fields, TagField, TagFields
from syncify.shared.core.enum import Fields, TagField, TagFields
from syncify.shared.core.object import Track, Library, Folder, Album, Artist, Genre
from syncify.shared.exception import SyncifyKeyError
from syncify.local.track.fields import LocalTrackField
from syncify.local.track.field import LocalTrackField
from syncify.local.base import LocalItem
from syncify.local.exception import LocalCollectionError
from syncify.local.track import LocalTrack, SyncResultTrack, load_track, TRACK_FILETYPES
from syncify.shared.remote.enums import RemoteIDType
from syncify.shared.remote.enum import RemoteIDType
from syncify.shared.remote.processors.wrangle import RemoteDataWrangler
from syncify.shared.types import UnitCollection
from syncify.shared.utils import get_most_common_values, to_collection, align_and_truncate, get_max_width
Expand Down
2 changes: 1 addition & 1 deletion src/syncify/local/library/library.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from syncify.shared.core.misc import Result, Filter
from syncify.shared.core.object import Playlist, Library
from syncify.shared.exception import SyncifyError
from syncify.local.track.fields import LocalTrackField
from syncify.local.track.field import LocalTrackField
from syncify.local.collection import LocalCollection, LocalFolder, LocalAlbum, LocalArtist, LocalGenres
from syncify.local.exception import LocalCollectionError
from syncify.local.playlist import PLAYLIST_FILETYPES, LocalPlaylist, load_playlist
Expand Down
2 changes: 1 addition & 1 deletion src/syncify/local/playlist/match.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from os.path import exists
from typing import Any, Self

from syncify.shared.core.enums import Fields
from syncify.shared.core.enum import Fields
from syncify.shared.core.misc import Result
from syncify.local.track import LocalTrack
from syncify.processors.base import MusicBeeProcessor
Expand Down
2 changes: 1 addition & 1 deletion src/syncify/local/playlist/xautopf.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import xmltodict

from syncify.shared.core.enums import Fields
from syncify.shared.core.enum import Fields
from syncify.shared.core.misc import Result
from syncify.local.playlist.match import LocalMatcher
from syncify.local.playlist.base import LocalPlaylist
Expand Down
4 changes: 2 additions & 2 deletions src/syncify/local/track/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from ._base.track import LocalTrack
from ._base.writer import SyncResultTrack
from .base.track import LocalTrack
from .base.writer import SyncResultTrack
from .flac import FLAC
from .m4a import M4A
from .mp3 import MP3
Expand Down
1 change: 0 additions & 1 deletion src/syncify/local/track/_base/__init__.py

This file was deleted.

Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
import mutagen
from PIL import Image

from syncify.shared.core.enums import TagMap
from syncify.shared.core.enum import TagMap
from syncify.shared.core.object import Track
from syncify.shared.exception import SyncifyValueError
from syncify.local.track.fields import LocalTrackField
from syncify.local.track.field import LocalTrackField
from syncify.local.base import LocalItem
from syncify.shared.remote.enums import RemoteIDType
from syncify.shared.remote.enum import RemoteIDType
from syncify.shared.remote.processors.wrangle import RemoteDataWrangler
from syncify.shared.types import UnitIterable
from syncify.shared.utils import to_collection
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
from syncify.shared.core.base import Item
from syncify.shared.core.object import Track
from syncify.shared.exception import SyncifyKeyError, SyncifyAttributeError, SyncifyTypeError
from syncify.shared.fields import TrackField
from syncify.shared.field import TrackField
from syncify.local.file import File
from syncify.local.exception import FileDoesNotExistError
from syncify.local.track._base.reader import TagReader
from syncify.local.track._base.writer import TagWriter
from syncify.local.track.base.reader import TagReader
from syncify.local.track.base.writer import TagWriter
from syncify.shared.remote.processors.wrangle import RemoteDataWrangler
from syncify.shared.types import UnitIterable

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
import mutagen

from syncify.shared.core.misc import Result
from syncify.local.track.fields import LocalTrackField as Tags
from syncify.local.track._base.reader import TagReader
from syncify.local.track.field import LocalTrackField as Tags
from syncify.local.track.base.reader import TagReader
from syncify.shared.types import UnitIterable
from syncify.shared.utils import to_collection

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from syncify.shared.core.enums import TagFields
from syncify.shared.fields import TrackFieldMixin
from syncify.shared.core.enum import TagFields
from syncify.shared.field import TrackFieldMixin


class LocalTrackField(TrackFieldMixin):
Expand Down
6 changes: 3 additions & 3 deletions src/syncify/local/track/flac.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
import mutagen.id3
from PIL import Image

from syncify.shared.core.enums import TagMap
from syncify.local.track.fields import LocalTrackField
from syncify.shared.core.enum import TagMap
from syncify.local.track.field import LocalTrackField
from syncify.local.file import open_image, get_image_bytes
from syncify.shared.remote.processors.wrangle import RemoteDataWrangler
from ._base import LocalTrack
from syncify.local.track.base.track import LocalTrack


class FLAC(LocalTrack):
Expand Down
4 changes: 2 additions & 2 deletions src/syncify/local/track/m4a.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
import mutagen.mp4
from PIL import Image

from syncify.shared.core.enums import TagMap
from syncify.shared.core.enum import TagMap
from syncify.local.file import open_image, get_image_bytes
from syncify.shared.remote.processors.wrangle import RemoteDataWrangler
from syncify.shared.utils import to_collection
from ._base import LocalTrack
from syncify.local.track.base.track import LocalTrack


class M4A(LocalTrack):
Expand Down
6 changes: 3 additions & 3 deletions src/syncify/local/track/mp3.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
import mutagen.mp3
from PIL import Image

from syncify.shared.core.enums import TagMap
from syncify.local.track.fields import LocalTrackField
from syncify.shared.core.enum import TagMap
from syncify.local.track.field import LocalTrackField
from syncify.local.file import open_image, get_image_bytes
from syncify.shared.remote.processors.wrangle import RemoteDataWrangler
from ._base import LocalTrack
from syncify.local.track.base.track import LocalTrack


class MP3(LocalTrack):
Expand Down
4 changes: 2 additions & 2 deletions src/syncify/local/track/wma.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
import mutagen.id3
from PIL import Image, UnidentifiedImageError

from syncify.shared.core.enums import TagMap
from syncify.shared.core.enum import TagMap
from syncify.local.file import open_image, get_image_bytes
from syncify.shared.remote.processors.wrangle import RemoteDataWrangler
from ._base import LocalTrack
from syncify.local.track.base.track import LocalTrack


class WMA(LocalTrack):
Expand Down
4 changes: 2 additions & 2 deletions src/syncify/processors/compare.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
from typing import Any, Self

from syncify.shared.core.base import Item
from syncify.shared.core.enums import Field
from syncify.local.track.fields import LocalTrackField
from syncify.shared.core.enum import Field
from syncify.local.track.field import LocalTrackField
from syncify.local.exception import FieldError
from syncify.processors.base import DynamicProcessor, MusicBeeProcessor, dynamicprocessormethod
from syncify.processors.exception import ItemComparerError
Expand Down
2 changes: 1 addition & 1 deletion src/syncify/processors/limit.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from typing import Any, Self

from syncify.shared.core.base import Item
from syncify.shared.core.enums import SyncifyEnum, Fields
from syncify.shared.core.enum import SyncifyEnum, Fields
from syncify.shared.core.object import Track
from syncify.local.file import File
from syncify.processors.base import DynamicProcessor, MusicBeeProcessor, dynamicprocessormethod
Expand Down
2 changes: 1 addition & 1 deletion src/syncify/processors/match.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

from syncify.shared.core.base import NamedObject
from syncify.shared.core.collection import ItemCollection
from syncify.shared.core.enums import TagField, TagFields as Tag, ALL_TAG_FIELDS
from syncify.shared.core.enum import TagField, TagFields as Tag, ALL_TAG_FIELDS
from syncify.shared.core.misc import PrettyPrinter
from syncify.shared.core.object import Track, Album
from syncify.processors.base import ItemProcessor
Expand Down
2 changes: 1 addition & 1 deletion src/syncify/processors/sort.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from typing import Any, Self

from syncify.shared.core.base import Item
from syncify.shared.core.enums import SyncifyEnum, Field, Fields
from syncify.shared.core.enum import SyncifyEnum, Field, Fields
from syncify.local.exception import FieldError
from syncify.processors.base import MusicBeeProcessor
from syncify.shared.types import UnitSequence, UnitIterable
Expand Down
2 changes: 1 addition & 1 deletion src/syncify/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from syncify.shared.core.base import Item
from syncify.shared.core.collection import ItemCollection
from syncify.shared.core.enums import TagField, Fields, ALL_FIELDS, TagFields
from syncify.shared.core.enum import TagField, Fields, ALL_FIELDS, TagFields
from syncify.shared.core.object import Library, Playlist
from syncify.local.library import LocalLibrary
from syncify.shared.utils import align_and_truncate, get_max_width, to_collection
Expand Down
2 changes: 1 addition & 1 deletion src/syncify/shared/core/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from collections.abc import Hashable
from typing import Any

from syncify.shared.core.enums import TagField
from syncify.shared.core.enum import TagField
from syncify.shared.core.misc import PrettyPrinter


Expand Down
2 changes: 1 addition & 1 deletion src/syncify/shared/core/collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from typing import Any, SupportsIndex, Self

from syncify.shared.core.base import Item, NamedObjectPrinter
from syncify.shared.core.enums import Field
from syncify.shared.core.enum import Field
from syncify.shared.exception import SyncifyTypeError, SyncifyKeyError
from syncify.processors.sort import ShuffleMode, ShuffleBy, ItemSorter
from syncify.shared.types import UnitSequence
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from typing import Self

from syncify.shared.core.enums import Field, Fields, TagField, TagFields
from syncify.shared.core.enum import Field, Fields, TagField, TagFields


class TrackFieldMixin(TagField):
Expand Down
2 changes: 1 addition & 1 deletion src/syncify/shared/remote/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from typing import Any, Self

from syncify.shared.api.request import RequestHandler
from syncify.shared.remote.enums import RemoteIDType, RemoteObjectType
from syncify.shared.remote.enum import RemoteIDType, RemoteObjectType
from syncify.shared.remote.processors.wrangle import RemoteDataWrangler
from syncify.shared.remote.types import APIMethodInputType
from syncify.shared.utils import align_and_truncate
Expand Down
2 changes: 1 addition & 1 deletion src/syncify/shared/remote/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from syncify.shared.core.base import Item, NamedObjectPrinter
from syncify.shared.api.exception import APIError
from syncify.shared.remote.api import RemoteAPI
from syncify.shared.remote._base import Remote
from syncify.shared.remote import Remote


class RemoteObject(NamedObjectPrinter, Remote, metaclass=ABCMeta):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from syncify.shared.core.enums import SyncifyEnum
from syncify.shared.core.enum import SyncifyEnum


class RemoteIDType(SyncifyEnum):
Expand Down
2 changes: 1 addition & 1 deletion src/syncify/shared/remote/exception.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from typing import Any

from syncify.shared.exception import SyncifyError
from syncify.shared.remote.enums import RemoteIDType, RemoteObjectType
from syncify.shared.remote.enum import RemoteIDType, RemoteObjectType


class RemoteError(SyncifyError):
Expand Down
2 changes: 1 addition & 1 deletion src/syncify/shared/remote/library.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from syncify.shared.core.object import Track, Library, Playlist
from syncify.shared.remote.api import RemoteAPI
from syncify.shared.remote.config import RemoteObjectClasses
from syncify.shared.remote.enums import RemoteObjectType
from syncify.shared.remote.enum import RemoteObjectType
from syncify.shared.remote.object import RemoteTrack, RemoteCollection, RemotePlaylist, SyncResultRemotePlaylist, \
RemoteArtist, RemoteAlbum
from syncify.shared.utils import align_and_truncate, get_max_width
Expand Down
2 changes: 1 addition & 1 deletion src/syncify/shared/remote/object.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from syncify.shared.api.exception import APIError
from syncify.shared.exception import SyncifyKeyError
from syncify.shared.remote.api import RemoteAPI
from syncify.shared.remote.enums import RemoteIDType
from syncify.shared.remote.enum import RemoteIDType
from syncify.shared.remote.exception import RemoteIDTypeError, RemoteError
from syncify.shared.remote.base import RemoteObject, RemoteItem
from syncify.shared.remote.processors.wrangle import RemoteDataWrangler
Expand Down
4 changes: 2 additions & 2 deletions src/syncify/shared/remote/processors/check.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
from syncify import PROGRAM_NAME
from syncify.shared.core.base import Item
from syncify.shared.core.collection import ItemCollection
from syncify.shared.core.enums import Fields
from syncify.shared.core.enum import Fields
from syncify.shared.core.misc import Result
from syncify.shared.core.object import Track
from syncify.processors.match import ItemMatcher
from syncify.shared.remote.api import RemoteAPI
from syncify.shared.remote.config import RemoteObjectClasses
from syncify.shared.remote.enums import RemoteObjectType, RemoteIDType
from syncify.shared.remote.enum import RemoteObjectType, RemoteIDType
from syncify.shared.remote.processors.search import RemoteItemSearcher
from syncify.shared.remote.processors.wrangle import RemoteDataWrangler
from syncify.shared.utils import get_user_input, get_max_width, align_and_truncate
Expand Down
6 changes: 3 additions & 3 deletions src/syncify/shared/remote/processors/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@

from syncify.shared.core.base import Item, NamedObject
from syncify.shared.core.collection import ItemCollection
from syncify.shared.core.enums import TagField, TagFields as Tag
from syncify.shared.core.enum import TagField, TagFields as Tag
from syncify.shared.core.misc import Result
from syncify.shared.core.object import Track
from syncify.processors.match import ItemMatcher
from syncify.shared.remote.api import RemoteAPI
from syncify.shared.remote._base import Remote
from syncify.shared.remote import Remote
from syncify.shared.remote.config import RemoteObjectClasses
from syncify.shared.remote.enums import RemoteObjectType
from syncify.shared.remote.enum import RemoteObjectType
from syncify.shared.utils import align_and_truncate, get_max_width
from syncify.shared.logger import REPORT

Expand Down
4 changes: 2 additions & 2 deletions src/syncify/shared/remote/processors/wrangle.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
from collections.abc import Mapping
from typing import Any

from syncify.shared.remote._base import Remote
from syncify.shared.remote.enums import RemoteIDType, RemoteObjectType
from syncify.shared.remote import Remote
from syncify.shared.remote.enum import RemoteIDType, RemoteObjectType
from syncify.shared.remote.exception import RemoteObjectTypeError
from syncify.shared.remote.types import APIMethodInputType

Expand Down
2 changes: 1 addition & 1 deletion src/syncify/spotify/api/item.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

from syncify.shared.api.exception import APIError
from syncify.shared.remote.api import APIMethodInputType
from syncify.shared.remote.enums import RemoteObjectType, RemoteIDType
from syncify.shared.remote.enum import RemoteObjectType, RemoteIDType
from syncify.shared.remote.exception import RemoteObjectTypeError
from syncify.spotify.api.base import SpotifyAPIBase
from syncify.shared.utils import limit_value
Expand Down
2 changes: 1 addition & 1 deletion src/syncify/spotify/api/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from collections.abc import MutableMapping
from typing import Any

from syncify.shared.remote.enums import RemoteIDType, RemoteObjectType
from syncify.shared.remote.enum import RemoteIDType, RemoteObjectType
from syncify.spotify.api.base import SpotifyAPIBase
from syncify.shared.utils import limit_value

Expand Down
2 changes: 1 addition & 1 deletion src/syncify/spotify/api/playlist.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from typing import Any

from syncify import PROGRAM_NAME, PROGRAM_URL
from syncify.shared.remote.enums import RemoteIDType, RemoteObjectType
from syncify.shared.remote.enum import RemoteIDType, RemoteObjectType
from syncify.shared.remote.exception import RemoteIDTypeError
from syncify.spotify.api.base import SpotifyAPIBase
from syncify.shared.utils import limit_value
Expand Down
Loading

0 comments on commit f2c5779

Please sign in to comment.