Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


Update sources from command line?
#7
(05-02-2018, 12:30 PM)TheOldPresbyope Wrote:
(05-02-2018, 09:50 AM)sjoerdju Wrote: Ok, it was rather easy:

Used https://www.tecmint.com/ssh-passwordless...asy-steps/ to set op the ssh.

The script:

Quote:osmc@osmc:~$ cat /usr/bin/cdtest
#!/bin/bash
LOGFILE=/var/log/cdrip.log
echo "$(date)" >> $LOGFILE

sleep 10

(
 # Wait for lock on /var/lock/.audio-cd-rip.lock (fd 200) for two hours
       flock -x -w 7200 200 || exit 1

       abcde 2>&1 >> $LOGFILE
       rc=$?
       if [[ $rc != 0 ]] ; then
               eject
               exit $rc
       fi
ssh pi@moode mpc update >> $LOGFILE
ssh pi@moode truncate /var/local/www/libcache.json --size 0
echo "LOG END" >> $LOGFILE
) 200>/var/lock/.audio-cd-rip.lock

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).

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

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,
# the alternative is to specify 'musicbrainz':
CDDBMETHOD=cddb


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/abcd...umart.html

I made the following UDEV rule:

Code:
osmc@osmc:~$ cat /etc/udev/rules.d/999-cdinster.rules
SUBSYSTEM=="block", KERNEL=="sr0", ENV{ID_CDROM_MEDIA_CD}=="1", TAG+="systemd", ENV{SYSTEMD_WANTS}="cdinsert.service", RUN+="/bin/systemctl start cdinsert.service"

and the following service:


Code:
osmc@osmc:~$ cat /etc/systemd/system/cdinsert.service
[Unit]
Description=Ripping CD
After=udisks-glue

[Service]
User=osmc
Group=osmc
Type=oneshot
ExecStart=/usr/bin/cdtest

Somehow it didn't work by pointing the UDEV rule to the script, so I had to do it by making a .service.
Reply


Messages In This Thread
Update sources from command line? - by sjoerdju - 05-01-2018, 12:26 PM
RE: Update sources from command line? - by sjoerdju - 05-03-2018, 12:40 PM
RE: Update sources from command line? - by DRONE7 - 05-03-2018, 10:22 PM
RE: Update sources from command line? - by DRONE7 - 05-10-2018, 06:20 AM

Forum Jump: