catharsis / spotifile

FUSE file system for Spotify
BSD 3-Clause "New" or "Revised" License
144 stars 7 forks source link

Set ctime/mtime on tracks/playlists #40

Closed chelmertz closed 2 years ago

chelmertz commented 8 years ago

Use case: I want to create a backup of the music library using some variant of ls -alR ./mounted-spotifile/playlists | grep -v unwanted_meta_files > my_music_library.txt. Having access to the spotify data of when the playlist was created (A) and when a track was added to it (B) would be very nice, especially in the form of custom ctime/mtime values.

(A) is easy enough, there exists a sp_playlist_create_time(sp_playlist *playlist, int index) callback. I have not found anything for (B) yet.

Ctime/mtime is set by spotifile in spfs_entity_create()


Perhaps this issue is moot and a proper solution would be to export all playlists in XSPF (see #37 and http://www.xspf.org/xspf-v1.html#rfc.section.4.1.1.2.8)...

catharsis commented 8 years ago

Exposing metadata such as creation time through stat() is exactly the kind of thing I want to do, especially when the mapping is straightforward. One key project goal is to make scripting of your music collection simple.

As a matter of fact, tracks in playlists already expose when they were added to a given playlist through their ctime. Is that what you're after in (B)?

chelmertz commented 8 years ago

As a matter of fact, tracks in playlists already expose when they were added to a given playlist through their ctime. Is that what you're after in (B)?

That is correct, (B)'s already implemented. Nice!

I guess that #15 is also required for the ls playlists > my_library.txt which requires some "breaking" changes. I'll look at (A).