jwallet / spy-spotify

🎤 Records Spotify to mp3 without ads and adds media tags to the files 🎵
https://jwallet.github.io/spy-spotify/
MIT License
2.11k stars 139 forks source link

Track numbers set as 1 greater than should be #453

Open techdog0 opened 1 year ago

techdog0 commented 1 year ago

What is the bug ?

A clear and concise description of what the bug is. Steps to reproduce the behavior or describe the expected behavior:

Configuration is set to write counter to track number in MP3. Track number that gets written is 1 greater than actual track number AND track number/counter used in file name.

It seems like the counter is being incremented to write the file name before the track number is written to the file attributes.

If there is nothing following on spotify, that is, if it is the last track to record, it works fine.

Track used

Spotify track/playlist used : https://open.spotify.com/search

Screenshots

If applicable, add screenshots to help explain your problem.

jwallet commented 1 year ago

I try both settings

They seem to work correctly, the counter will be apply on track being recorded, so when the recording ends, a new track is being recorded and the one that is encoded to mp3 will have the previous counter value since the new value will be apply to the track you are hearing which is not encoded yet.

If the counter value is 9 and you skip the track it will look something like that

[11:07:01] Recording: Red Hot Chili Peppers - Under the Bridge #counter value is 9
[11:07:11] Recorded: ..\Red Hot Chili Peppers - Under the Bridge.mp3 in 00:09 #counter value 9 applied
[11:07:19] Recording: Foo Fighters - Learn to Fly #counter value is 10

If you stop the session the counter value increments to 11 since it will encode the last track to mp3 and will set the next value for the next session.

image image