syncfm-core 0.2.2__tar.gz → 0.2.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {syncfm_core-0.2.2 → syncfm_core-0.2.4}/PKG-INFO +1 -1
- {syncfm_core-0.2.2 → syncfm_core-0.2.4}/pyproject.toml +1 -1
- {syncfm_core-0.2.2 → syncfm_core-0.2.4}/pyproject.toml.orig +1 -1
- {syncfm_core-0.2.2 → syncfm_core-0.2.4}/src/syncfm_core/models/sync_progress.py +2 -0
- {syncfm_core-0.2.2 → syncfm_core-0.2.4}/src/syncfm_core/services/metadata_service.py +10 -1
- {syncfm_core-0.2.2 → syncfm_core-0.2.4}/src/syncfm_core/services/sync_service.py +20 -1
- {syncfm_core-0.2.2 → syncfm_core-0.2.4}/LICENSE +0 -0
- {syncfm_core-0.2.2 → syncfm_core-0.2.4}/README.md +0 -0
- {syncfm_core-0.2.2 → syncfm_core-0.2.4}/src/syncfm_core/__init__.py +0 -0
- {syncfm_core-0.2.2 → syncfm_core-0.2.4}/src/syncfm_core/application.py +0 -0
- {syncfm_core-0.2.2 → syncfm_core-0.2.4}/src/syncfm_core/cli/__init__.py +0 -0
- {syncfm_core-0.2.2 → syncfm_core-0.2.4}/src/syncfm_core/cli/app.py +0 -0
- {syncfm_core-0.2.2 → syncfm_core-0.2.4}/src/syncfm_core/cli/commands/__init__.py +0 -0
- {syncfm_core-0.2.2 → syncfm_core-0.2.4}/src/syncfm_core/cli/commands/common.py +0 -0
- {syncfm_core-0.2.2 → syncfm_core-0.2.4}/src/syncfm_core/cli/commands/discard.py +0 -0
- {syncfm_core-0.2.2 → syncfm_core-0.2.4}/src/syncfm_core/cli/commands/profile.py +0 -0
- {syncfm_core-0.2.2 → syncfm_core-0.2.4}/src/syncfm_core/cli/commands/resume.py +0 -0
- {syncfm_core-0.2.2 → syncfm_core-0.2.4}/src/syncfm_core/cli/commands/status.py +0 -0
- {syncfm_core-0.2.2 → syncfm_core-0.2.4}/src/syncfm_core/cli/commands/sync.py +0 -0
- {syncfm_core-0.2.2 → syncfm_core-0.2.4}/src/syncfm_core/cli/configuration.py +0 -0
- {syncfm_core-0.2.2 → syncfm_core-0.2.4}/src/syncfm_core/cli/context.py +0 -0
- {syncfm_core-0.2.2 → syncfm_core-0.2.4}/src/syncfm_core/cli/dashboard.py +0 -0
- {syncfm_core-0.2.2 → syncfm_core-0.2.4}/src/syncfm_core/cli/presenters.py +0 -0
- {syncfm_core-0.2.2 → syncfm_core-0.2.4}/src/syncfm_core/cli/verification.py +0 -0
- {syncfm_core-0.2.2 → syncfm_core-0.2.4}/src/syncfm_core/exceptions.py +0 -0
- {syncfm_core-0.2.2 → syncfm_core-0.2.4}/src/syncfm_core/models/__init__.py +0 -0
- {syncfm_core-0.2.2 → syncfm_core-0.2.4}/src/syncfm_core/models/network_config.py +0 -0
- {syncfm_core-0.2.2 → syncfm_core-0.2.4}/src/syncfm_core/models/retry_policy.py +0 -0
- {syncfm_core-0.2.2 → syncfm_core-0.2.4}/src/syncfm_core/models/scrobble.py +0 -0
- {syncfm_core-0.2.2 → syncfm_core-0.2.4}/src/syncfm_core/models/sync_queue_item.py +0 -0
- {syncfm_core-0.2.2 → syncfm_core-0.2.4}/src/syncfm_core/models/sync_request.py +0 -0
- {syncfm_core-0.2.2 → syncfm_core-0.2.4}/src/syncfm_core/models/sync_result.py +0 -0
- {syncfm_core-0.2.2 → syncfm_core-0.2.4}/src/syncfm_core/models/sync_session.py +0 -0
- {syncfm_core-0.2.2 → syncfm_core-0.2.4}/src/syncfm_core/models/sync_status.py +0 -0
- {syncfm_core-0.2.2 → syncfm_core-0.2.4}/src/syncfm_core/models/sync_verification.py +0 -0
- {syncfm_core-0.2.2 → syncfm_core-0.2.4}/src/syncfm_core/networks/__init__.py +0 -0
- {syncfm_core-0.2.2 → syncfm_core-0.2.4}/src/syncfm_core/networks/factory.py +0 -0
- {syncfm_core-0.2.2 → syncfm_core-0.2.4}/src/syncfm_core/networks/gnufm.py +0 -0
- {syncfm_core-0.2.2 → syncfm_core-0.2.4}/src/syncfm_core/networks/pylast_adapter.py +0 -0
- {syncfm_core-0.2.2 → syncfm_core-0.2.4}/src/syncfm_core/networks/pylast_mapper.py +0 -0
- {syncfm_core-0.2.2 → syncfm_core-0.2.4}/src/syncfm_core/profiles/__init__.py +0 -0
- {syncfm_core-0.2.2 → syncfm_core-0.2.4}/src/syncfm_core/profiles/factory.py +0 -0
- {syncfm_core-0.2.2 → syncfm_core-0.2.4}/src/syncfm_core/profiles/keyring_store.py +0 -0
- {syncfm_core-0.2.2 → syncfm_core-0.2.4}/src/syncfm_core/profiles/models.py +0 -0
- {syncfm_core-0.2.2 → syncfm_core-0.2.4}/src/syncfm_core/profiles/paths.py +0 -0
- {syncfm_core-0.2.2 → syncfm_core-0.2.4}/src/syncfm_core/profiles/protocols.py +0 -0
- {syncfm_core-0.2.2 → syncfm_core-0.2.4}/src/syncfm_core/profiles/resolver.py +0 -0
- {syncfm_core-0.2.2 → syncfm_core-0.2.4}/src/syncfm_core/profiles/service.py +0 -0
- {syncfm_core-0.2.2 → syncfm_core-0.2.4}/src/syncfm_core/profiles/toml_store.py +0 -0
- {syncfm_core-0.2.2 → syncfm_core-0.2.4}/src/syncfm_core/protocols/__init__.py +0 -0
- {syncfm_core-0.2.2 → syncfm_core-0.2.4}/src/syncfm_core/protocols/network.py +0 -0
- {syncfm_core-0.2.2 → syncfm_core-0.2.4}/src/syncfm_core/protocols/repositories.py +0 -0
- {syncfm_core-0.2.2 → syncfm_core-0.2.4}/src/syncfm_core/py.typed +0 -0
- {syncfm_core-0.2.2 → syncfm_core-0.2.4}/src/syncfm_core/repositories/__init__.py +0 -0
- {syncfm_core-0.2.2 → syncfm_core-0.2.4}/src/syncfm_core/repositories/database.py +0 -0
- {syncfm_core-0.2.2 → syncfm_core-0.2.4}/src/syncfm_core/repositories/queue_repository.py +0 -0
- {syncfm_core-0.2.2 → syncfm_core-0.2.4}/src/syncfm_core/repositories/schema.py +0 -0
- {syncfm_core-0.2.2 → syncfm_core-0.2.4}/src/syncfm_core/repositories/session_repository.py +0 -0
- {syncfm_core-0.2.2 → syncfm_core-0.2.4}/src/syncfm_core/repositories/snapshot_repository.py +0 -0
- {syncfm_core-0.2.2 → syncfm_core-0.2.4}/src/syncfm_core/services/__init__.py +0 -0
- {syncfm_core-0.2.2 → syncfm_core-0.2.4}/src/syncfm_core/services/comparison_service.py +0 -0
- {syncfm_core-0.2.2 → syncfm_core-0.2.4}/src/syncfm_core/services/range_resolver.py +0 -0
- {syncfm_core-0.2.2 → syncfm_core-0.2.4}/src/syncfm_core/services/recovery_service.py +0 -0
- {syncfm_core-0.2.2 → syncfm_core-0.2.4}/src/syncfm_core/services/retry_service.py +0 -0
- {syncfm_core-0.2.2 → syncfm_core-0.2.4}/src/syncfm_core/services/snapshot_service.py +0 -0
- {syncfm_core-0.2.2 → syncfm_core-0.2.4}/src/syncfm_core/services/submission_service.py +0 -0
- {syncfm_core-0.2.2 → syncfm_core-0.2.4}/src/syncfm_core/services/verification_service.py +0 -0
|
@@ -4,6 +4,7 @@ from collections.abc import Callable
|
|
|
4
4
|
from dataclasses import dataclass
|
|
5
5
|
|
|
6
6
|
from syncfm_core.models.scrobble import Scrobble
|
|
7
|
+
from syncfm_core.models.sync_request import SyncRange
|
|
7
8
|
from syncfm_core.models.sync_session import SyncPhase
|
|
8
9
|
|
|
9
10
|
|
|
@@ -17,6 +18,7 @@ class SyncProgress:
|
|
|
17
18
|
current_scrobble: Scrobble | None = None
|
|
18
19
|
current_scrobble_completed: bool = False
|
|
19
20
|
current_scrobble_failed: bool = False
|
|
21
|
+
sync_range: SyncRange | None = None
|
|
20
22
|
|
|
21
23
|
def __post_init__(self) -> None:
|
|
22
24
|
"""Validate progress values."""
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"""Enrich queued scrobbles with separately retrieved metadata."""
|
|
2
2
|
|
|
3
|
+
from dataclasses import replace
|
|
3
4
|
from functools import partial
|
|
4
5
|
|
|
5
6
|
from syncfm_core.exceptions import NetworkError, SynchronizationError
|
|
@@ -97,9 +98,17 @@ class MetadataService:
|
|
|
97
98
|
SyncStatus.READY,
|
|
98
99
|
)
|
|
99
100
|
|
|
101
|
+
enriched_scrobble = replace(
|
|
102
|
+
item.scrobble,
|
|
103
|
+
metadata=metadata,
|
|
104
|
+
)
|
|
105
|
+
|
|
100
106
|
completed += 1
|
|
101
107
|
self._report_progress(
|
|
102
|
-
completed,
|
|
108
|
+
completed,
|
|
109
|
+
total,
|
|
110
|
+
enriched_scrobble,
|
|
111
|
+
current_scrobble_completed=True,
|
|
103
112
|
)
|
|
104
113
|
|
|
105
114
|
def _report_progress(
|
|
@@ -87,6 +87,10 @@ class SyncService:
|
|
|
87
87
|
"""
|
|
88
88
|
self._validate_profile_pair(source_profile, target_profile)
|
|
89
89
|
sync_range = self._range_resolver.resolve(request, target)
|
|
90
|
+
self._report_phase(
|
|
91
|
+
SyncPhase.CREATED,
|
|
92
|
+
sync_range=sync_range,
|
|
93
|
+
)
|
|
90
94
|
session = self._create_session(
|
|
91
95
|
source,
|
|
92
96
|
target,
|
|
@@ -130,6 +134,16 @@ class SyncService:
|
|
|
130
134
|
"""
|
|
131
135
|
session = self.get_session(session_id)
|
|
132
136
|
self._validate_resume_networks(session, source, target)
|
|
137
|
+
|
|
138
|
+
sync_range = SyncRange(
|
|
139
|
+
start_timestamp=session.start_timestamp,
|
|
140
|
+
end_timestamp=session.end_timestamp,
|
|
141
|
+
)
|
|
142
|
+
self._report_phase(
|
|
143
|
+
session.phase,
|
|
144
|
+
sync_range=sync_range,
|
|
145
|
+
)
|
|
146
|
+
|
|
133
147
|
self._record_resume_profiles(
|
|
134
148
|
session,
|
|
135
149
|
source_profile,
|
|
@@ -289,7 +303,11 @@ class SyncService:
|
|
|
289
303
|
self._session_repository.update_phase(session_id, phase)
|
|
290
304
|
self._report_phase(phase)
|
|
291
305
|
|
|
292
|
-
def _report_phase(
|
|
306
|
+
def _report_phase(
|
|
307
|
+
self,
|
|
308
|
+
phase: SyncPhase,
|
|
309
|
+
sync_range: SyncRange | None = None,
|
|
310
|
+
) -> None:
|
|
293
311
|
"""Report a synchronization phase to the frontend."""
|
|
294
312
|
if self._progress_callback is not None:
|
|
295
313
|
self._progress_callback(
|
|
@@ -297,6 +315,7 @@ class SyncService:
|
|
|
297
315
|
phase=phase,
|
|
298
316
|
completed=0,
|
|
299
317
|
total=0,
|
|
318
|
+
sync_range=sync_range,
|
|
300
319
|
)
|
|
301
320
|
)
|
|
302
321
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|