![]() |
Update sources from command line? - Printable Version +- Moode Forum (https://moodeaudio.org/forum) +-- Forum: moOde audio player (https://moodeaudio.org/forum/forumdisplay.php?fid=3) +--- Forum: Support (https://moodeaudio.org/forum/forumdisplay.php?fid=7) +--- Thread: Update sources from command line? (/showthread.php?tid=143) Pages:
1
2
|
Update sources from command line? - sjoerdju - 05-01-2018 Hi there, I automatically rip CD's when inserted with a script and copy the FLACs to my NAS. It would be nice to also be able to automatically update the Moode library from the script, since it's the only manual step I have to take now. Is there any way to do this from the shell? I've been looking at the forum and documentation and cannot find it. If there is none, maybe you can point me to the correct files (php or otherwise) handling this? Maybe I can code a shell script for it and share it, if I find the time ![]() Thnx! RE: Update sources from command line? - Tim Curtis - 05-01-2018 If your rip and copy process is happening on a remote computer then: 1) update MPD database telnet moode 6600 update 2) truncate library cache so Library panel reloads from scratch ssh pi@moode truncate /var/local/www/libcache.json --size 0 I'm not sure how to automate (2) The other option is to create a bash script in /var/www which contains the cmds below then run it remotely via the following url: http://moode/command?cmd=test.sh #!/bin/bash # # /var/www/test.sh # mpc update truncate /var/local/www/libcache.json --size 0 -Tim RE: Update sources from command line? - TheOldPresbyope - 05-02-2018 (05-01-2018, 11:26 PM)Tim Curtis Wrote: If your rip and copy process is happening on a remote computer then: If you set up authentication keys on the two hosts, you can use password-less ssh login to execute the command Code: ssh pi@moode truncate /var/local/www/libcache.json --size 0 Obviously this can be generalized. You could use this to execute both commands, one at a time, or you could put the script in pi's home directory and execute it using this same technique. RE: Update sources from command line? - sjoerdju - 05-02-2018 Great, thnx for the pointers and necessary steps. Should be pretty easy. It rips from a separate RPI3 OSMC setup as soon as the CD is inserted, then copies over NFS to a Rock64 NAS and then shares the FLACs to Moode (RPI2/Mamboberry/Kali). The ssh option seems the more secure, gonna figure this out. I will post the best solution when done for future reference ![]() Thnx again! RE: Update sources from command line? - sjoerdju - 05-02-2018 Ok, it was rather easy: Used https://www.tecmint.com/ssh-passwordless-login-using-ssh-keygen-in-5-easy-steps/ to set op the ssh. The script: Quote:osmc@osmc:~$ cat /usr/bin/cdtest If anybody wants to do something similar; make sure to use UDEV to trigger the ripping proces (other options won't work on the Pi). RE: Update sources from command line? - TheOldPresbyope - 05-02-2018 (05-02-2018, 09:50 AM)sjoerdju Wrote: Ok, it was rather easy: Great! By the way, this is a very cool automation. What ripping tool are you using? Are you satisfied with the track names and tags it assigns? I haven't found a tool yet I totally trust. Operas especially are a challenge and I have a bunch of classics on CD. Regards, Kent RE: Update sources from command line? - sjoerdju - 05-03-2018 (05-02-2018, 12:30 PM)TheOldPresbyope Wrote:(05-02-2018, 09:50 AM)sjoerdju Wrote: Ok, it was rather easy: Thnx! I wanted to rip my whole collection, so now it's easy just to put in a CD and walk away and do the next one when I get back. Currently I'm using abcde. http://www.andrews-corner.org/linux/abcde/index.html It works great, but indeed the way it identifies classical composers/performers/albums is quite bad, i'm not sure how to fix it yet (other then manual editing, which is a hassle). I suspect the only option is to help improve the databases recognising classical CDs, since most other albums are recognised correctly. The problem is not as much the ripping tool afaik, but the database which is used: Code: # Specify the method to use to retrieve the track information, But I haven't tried the other one yet. It makes you choose when there are more options detected albums (I defaulted it for now), but there is often not much difference between the options. B I did manage to make it download album art automatically, when it's available: http://www.andrews-corner.org/linux/abcde/getalbumart.html I made the following UDEV rule: Code: osmc@osmc:~$ cat /etc/udev/rules.d/999-cdinster.rules and the following service: Code: osmc@osmc:~$ cat /etc/systemd/system/cdinsert.service Somehow it didn't work by pointing the UDEV rule to the script, so I had to do it by making a .service. RE: Update sources from command line? - DRONE7 - 05-03-2018 Code: # Specify the method to use to retrieve the track information, You can try both for each lookup.... Code: # Specify the method to use to retrieve the track information, if it is not found on the first it tries the second and, yes, popular music is much better tagged and found as it is, surprise, popular (= more submitters and possibly listeners to classical are less inclined to rip ?? ripping for mobile environments being not so successful a use case ;-) RE: Update sources from command line? - sjoerdju - 05-04-2018 Ah, great tip, I'll try this in reverse order (musicbrainz first). Thnx! The problem is not as much that the CDs are not recognised (at least in my case) but that the tags and metadata are incorrect or just plain weird. A classical pieces has for example a famous composer, choir, director, orchestra, etc. Sometimes the artist named is the composer or the orchestra instead of the composer for example. This makes it hard to identify the CD afterward. This discussion reminded me I still had to work on this ![]() I will be in Paris for a couple of weeks, so not sure wether I'll have time to work on it, but I'll post an update/config as soon as I figured it out. RE: Update sources from command line? - TheOldPresbyope - 05-04-2018 (05-04-2018, 11:08 AM)sjoerdju Wrote: ... Yeah, that's my problem too, and I've tried just about every online database. I've ripped multi-CD operas where the metadata from online sources isn't consistent even among the constituent CDs. Classical music is hard because there's much more musicological information which could be tagged and little agreement in the community about what should be tagged and how. No "one ring to rule them all". This surprises me a little given the passion of us classical enthusiasts but that's life. For a fun waste of an afternoon, try searching on phrases like "the best way to tag classical music". The horribly minimalist title/artist/album straight-jacket of the original ID3 Tag schema didn't help either. People got really creative with their track titles and artist names. Later versions of ID3 are much better---closer to the way I might define a primitive database---but old habits die hard. Incidentally, Apple has published a nicely written style guide: https://help.apple.com/itc/musicstyleguide/en.lproj/static.html I've done most of my ripping in Windows because the tools available seemed more complete, I suppose because it's a bigger market, but that's just a matter of taste. @DRONE7 - yes, a lot of classical fans rip CDs (even LPs!); there are just so few of us ![]() Regards, Kent |