Reply To: Song rating for Firefly via Roku Soundbridge

#17266
Anonymous
Inactive

Hello,

So I found a solution, the DBI and SQLite modules of perl seem not to support SQLite2 … but the software ic on my NSLU2 so I did it the dirty way (but its short and easy to understand 😉 )


$data = `sqlite /opt/var/mt-daapd/songs.db "SELECT rating FROM songs WHERE id = $m";`;
$data = int(($data+$likeit)/2+.5);
$display->msg(text => "I Like it! (".$data."%)", clear => 1, duration=>1, font => 10, x=>110, y=>0, keygrab=>2);
$data = `sqlite /opt/var/mt-daapd/songs.db "UPDATE songs SET rating = $data WHERE id = $m" `;

The first line reads the actual rating the next line calculates the new value for the rating (between 0 and 100). The $likeit can be 100 for a loved song and 0 for disliked songs. Then I give a visual feedback on the Roku Soundbridge display and write the new value to the database.

It seems to work – the smart playlist with “rating > 80” shows the songs I rated for testing. 😛

I will post again when I put an update of my Tools4Roku online.

CU
Juergen