issadarkthing / gomu

golang TUI music player
GNU General Public License v2.0
159 stars 15 forks source link

add support to sort by ctime #41

Closed issadarkthing closed 3 years ago

tramhao commented 3 years ago

It's working, but I have 2 issues,

  1. Open app for the 1st time, it's ok, but 2nd time is't not working, 3rd time is working, just repeat like this. To reproduce it: play a song, and during playing, quite the app. Then open it again, it's ok, but quit and open it'll not sort like the 1st reopen.
  2. Probably the getTagLength in utils.go could change ctime. Or probably it's the verysync service I'm running on my music folder. This service is a p2p synchronize service which keep the music folder the same on my different devices, like resillosync.

Haven't looking into the code so probably not so accurate. Thanks.

tramhao commented 3 years ago

probably because in my local copy, the getTaglength is modified like in my PR.

issadarkthing commented 3 years ago

I think it should sort by mtime as mtime is the time at which the file’s contents were last written to disk. This makes more sense since renaming an audio file should not be sorted first.

issadarkthing commented 3 years ago

mtime changes if tag is changed but does not change if renamed ctime changes if audio file is renamed but does not change if tag is changed

There is no exact way to inspect the file creation time except for particular filesystem like ext4.