Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SpotifyBackup
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Robert Goldmann
SpotifyBackup
Commits
2948eb9b
Commit
2948eb9b
authored
1 year ago
by
Robert Goldmann
Browse files
Options
Downloads
Patches
Plain Diff
SpotifyRecorder: cleanup
parent
9ff94944
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
SpotifyRecorder.py
+5
-7
5 additions, 7 deletions
SpotifyRecorder.py
with
5 additions
and
7 deletions
SpotifyRecorder.py
+
5
−
7
View file @
2948eb9b
...
@@ -80,9 +80,6 @@ class SpotifyRecorder:
...
@@ -80,9 +80,6 @@ class SpotifyRecorder:
LOGGER
.
info
(
f
'
Found
{
len
(
tracks
)
}
tracks in playlist
'
)
LOGGER
.
info
(
f
'
Found
{
len
(
tracks
)
}
tracks in playlist
'
)
return
results
return
results
def
__extract_track_uris
(
self
,
tracks
:
List
)
->
List
[
str
]:
return
[
track
[
'
track
'
][
'
uri
'
]
for
track
in
tracks
]
def
__record_tracks
(
self
,
tracks
:
list
):
def
__record_tracks
(
self
,
tracks
:
list
):
deviceId
=
self
.
__get_device_id_by_name
(
self
.
_spotifyDeviceName
)
deviceId
=
self
.
__get_device_id_by_name
(
self
.
_spotifyDeviceName
)
...
@@ -137,10 +134,6 @@ class SpotifyRecorder:
...
@@ -137,10 +134,6 @@ class SpotifyRecorder:
self
.
__print_end_statistics
(
errorTrackNumbers
,
recordedTrackNumbers
,
skippedTrackNumbers
,
len
(
tracks
))
self
.
__print_end_statistics
(
errorTrackNumbers
,
recordedTrackNumbers
,
skippedTrackNumbers
,
len
(
tracks
))
def
__join_artists
(
self
,
track
)
->
str
:
artists
=
track
[
'
track
'
][
'
artists
'
]
return
'
&
'
.
join
(
artist
[
'
name
'
]
for
artist
in
artists
)
def
__print_end_statistics
(
self
,
errorTrackNumbers
:
list
[
int
],
recordedTrackNumbers
:
list
[
int
],
def
__print_end_statistics
(
self
,
errorTrackNumbers
:
list
[
int
],
recordedTrackNumbers
:
list
[
int
],
skippedTrackNumbers
:
list
[
int
],
numberOfTracks
:
int
):
skippedTrackNumbers
:
list
[
int
],
numberOfTracks
:
int
):
LOGGER
.
info
(
'
### DONE ###
'
)
LOGGER
.
info
(
'
### DONE ###
'
)
...
@@ -161,6 +154,11 @@ class SpotifyRecorder:
...
@@ -161,6 +154,11 @@ class SpotifyRecorder:
fileName
=
f
'
{
index
}
-
{
artists
}
-
{
track
[
"
track
"
][
"
name
"
]
}
'
fileName
=
f
'
{
index
}
-
{
artists
}
-
{
track
[
"
track
"
][
"
name
"
]
}
'
return
os
.
path
.
join
(
self
.
_destinationFolder
,
fileName
)
return
os
.
path
.
join
(
self
.
_destinationFolder
,
fileName
)
@staticmethod
def
__join_artists
(
track
)
->
str
:
artists
=
track
[
'
track
'
][
'
artists
'
]
return
'
&
'
.
join
(
artist
[
'
name
'
]
for
artist
in
artists
)
def
__wait_for_track_end
(
self
,
track
,
timeWaitedForPlaying
:
float
)
->
None
:
def
__wait_for_track_end
(
self
,
track
,
timeWaitedForPlaying
:
float
)
->
None
:
trackDurationInMs
=
track
[
'
track
'
][
'
duration_ms
'
]
trackDurationInMs
=
track
[
'
track
'
][
'
duration_ms
'
]
trackDurationInSeconds
=
trackDurationInMs
//
1000
trackDurationInSeconds
=
trackDurationInMs
//
1000
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment