nega0 / pianobarfly

pandora2[mp3|m4a]
https://github.com/nega0/pianobarfly
Other
62 stars 31 forks source link

Fix issue #52 for mp3 files #69

Closed ryandesign closed 5 years ago

ryandesign commented 6 years ago

The fix for #52 only fixed the problem for m4a files. This PR applies the same fix for mp3 files.

ghost commented 6 years ago

I changed my copy to not use any mkstmp or separate dir for tmp. I just take the final filename in /mp3 (or wherever) and tack some junk onto that for the tmp file, a bit like the way a browser does the .crdownload, except I don't bother replacing or hiding the final extension. The tmp version of foo.mp3 is foo.mp3.t . dead simple both in code and at run-time because no possibility of a different fs or different dir write perms. Bonus, if a download dies half way through, you at least have the half recording, in a discoverable place, yet also quazi-hidden because it's not named foo.mp3 and so music players ignor it, but it's there if you want it (often times I do want even a scrap of a song that I really liked or found especially interesting, until I can track down a real copy)