Submitted by th on Sun, 2017-02-19 10:51
Hello,
I've developed Adrian's patch a little further to allow modification of the ratings:
https://github.com/hilgenberg/moc
The branch is based on 2.6-alpha3.
This works by creating plain text files in any directory that has rated music files.
Reasoning:
- Works for any file type and on all file systems
- Ratings belong to users, not to files. The ratings file name is an option (default: "ratings"), so you can do "ratings_alice", "ratings_bob", etc for shared music libraries
- Ratings are very easy to backup and very hard to lose
- Reorganizing folders is no problem
- Renaming files breaks the ratings, but seeing the ratings file should hint at that and you can still match them manually (or with some scripting) after that.
- Changing ratings does not change large binary files (which using tags would do) and slow down backups
- It's one file per directory, so there's not much clutter (and it's a bit like cover.jpg)
- Simple, fast, unixy and you can do all kinds of scripting with this (finding all 5-star songs for a playlist and such)
tomaszg
Sun, 2017-02-19 15:30
Permalink
Tried to buid it and I get
Tried to buid it and I get segmentation fault at start. I started MOC with --no-config. Here's the backtrace
Same thing happens with -D -no-config -O 'RatingShow=no'.
th
Sun, 2017-02-19 16:22
Permalink
Oops, I did some
Oops, I did some initialization in options_parse(...) (I thought that would always get called). Fix is in git. Sorry that it's mixed in with my other changes now.
And since we're in Contrib anyway, here's a script to find files by rating:
tomaszg
Sun, 2017-02-19 17:10
Permalink
Ok, thanks. Now it works.
Ok, thanks. Now it works. However first start was for some reason very long (I believed the app hung (at "Loading Playlist"). I don't know what was the reason and I can't reproduce it now.
As for the script, you could add it to tools directory in your repo. An idea: you could also expand it, so it could be called from within MOC via ExecCommand and feed its output back to MOC playlist.
th
Sun, 2017-02-19 18:04
Permalink
It probably updated the tags
It probably updated the tags cache on the first start. BTW: I've not looked into that at all (using moc with and without ratings in parallel and what that does to the tags cache).
tomaszg
Sun, 2017-02-19 18:12
Permalink
Tags were my guess as well,
Tags were my guess as well, but it was not that. I removed tags cache when investigation the previous segfault. Moreover since tags db version was bumped in the patch, MOC just discards older/newer tags cache without any problem.
Anyway, I'll try to cherry pick some of your changes and commit them also to my fork of MOC: https://github.com/tomaszg7/mocp
tomaszg
Mon, 2017-05-01 10:41
Permalink
I tried modifying this script
I tried modifying this script a bit to work better with ExecCommand but it turns out that since MOC client is single-threaded it doesn't work as I expected. Thus I just created a "helper" script:
which I trigger via
It would be better if MOC would have a %letter to give current directory in the interface (see https://github.com/tomaszg7/mocp/commit/c93fb042fac518bd040e12dcaf99549a54c0b6e8 in my fork), but since it doesn't I had to work around it.