Re: [slim] Ratings to files

2018-04-11 Thread Robbyell

Thanks chaps - much food for thought.  I'll carve some time out and have
a play.



Robbyell's Profile: http://forums.slimdevices.com/member.php?userid=64134
View this thread: http://forums.slimdevices.com/showthread.php?t=108896

___
discuss mailing list
discuss@lists.slimdevices.com
http://lists.slimdevices.com/mailman/listinfo/discuss


Re: [slim] Ratings to files

2018-04-08 Thread DJanGo

Roland0 wrote: 
> Paths are stored urlencoded in whatever encoding LMS is using.

*lol*


- I should update my internal python 2 brain decoder
- or run your script not with my virtual brain decoder but with the
  one from my computer before "posting"
  

Nice - very nice



DJanGo's Profile: http://forums.slimdevices.com/member.php?userid=1516
View this thread: http://forums.slimdevices.com/showthread.php?t=108896

___
discuss mailing list
discuss@lists.slimdevices.com
http://lists.slimdevices.com/mailman/listinfo/discuss


Re: [slim] Ratings to files

2018-04-07 Thread Roland0

DJanGo wrote: 
> 
> I would prefer a simple cmd for that - the python demo from Roland
> (IMHO) only make sense if the Filenames/paths are UTF-8 like 
> 
Paths are stored urlencoded in whatever encoding LMS is using

DJanGo wrote: 
> 
> If "thats" not needed - python is too complex for a "excel is a
> database" user.
Changing the script to write tags is trivial, however, it's pointless
for me to post this version until OP has confirmed he can actually run
it (for which he will have to install python and one python module).



SW: 'Web UI for LMS'
(http://forums.slimdevices.com/showthread.php?98186-Announce-Alternative-Web-Interface-(beta))
| 'Playlist Editor / Generator'
(http://forums.slimdevices.com/showthread.php?108199-Announce-LMS-Playlist-Editor)
| 'Music Classification'
(http://forums.slimdevices.com/showthread.php?108278-Announce-Essentia-Integration-music-classification-(moods-genres-))
| 'Similar Music'
(http://forums.slimdevices.com/showthread.php?108495-Announce-LMSmusly-play-similar-music)
| 'LMSlib2go' (https://www.nexus0.net/pub/sw/lmslib2go/)
HowTos: 'build a self-contained LMS'
(http://forums.slimdevices.com/showthread.php?99648-Howto-build-a-self-contained-LMS)
| 'Ogg Opus'
(http://forums.slimdevices.com/showthread.php?107011-Howto-play-Ogg-Opus-files)
| 'Bluetooth/ALSA'
(http://forums.slimdevices.com/showthread.php?107230-Howto-Bluetooth-streaming-to-from-LMS-(ALSA-only-no-PulseAudio))

Roland0's Profile: http://forums.slimdevices.com/member.php?userid=56808
View this thread: http://forums.slimdevices.com/showthread.php?t=108896

___
discuss mailing list
discuss@lists.slimdevices.com
http://lists.slimdevices.com/mailman/listinfo/discuss


Re: [slim] Ratings to files

2018-04-07 Thread DJanGo

Hi,

since he already had that csv - the main question is:

Is that a onetime task only or a aldayrunner?

A onetime solution (minimal) should look like:

Export 10 playlists each for a rating.

Import that playlist with eg, mp3tag and mark all tracks and add a tag
(popm whatever) with 1 or similar rating.
Repeat these steps for all playlists.

A alltime runner should also check is the rating already in the tag if
not change / add that rating to the file.
I would prefer a simple cmd for that - the python demo from Roland
(IMHO) only make sense if the Filenames/paths are UTF-8 like 
> x:\Røyksopp\The Girl and The Robot\Røyksopp - The Girl and The Robot -
> 01 - The Girl and The Robot (Album Version).mp3
Changing strings like that is a mess with vbs/cmd/powershell and a fun
with python.
If "thats" not needed - python is too complex for a "excel is a
database" user.



DJanGo's Profile: http://forums.slimdevices.com/member.php?userid=1516
View this thread: http://forums.slimdevices.com/showthread.php?t=108896

___
discuss mailing list
discuss@lists.slimdevices.com
http://lists.slimdevices.com/mailman/listinfo/discuss


Re: [slim] Ratings to files

2018-04-06 Thread Roland0

Robbyell wrote: 
> 
> Anyone got any thoughts then as to how I'd get the Excel info into a new
> player?!  By the sounds, if the player accepts POPM as an example, I'd
> need to:
> a) take the filename and the ratings (currently expressed as 1-5 in
> Excel) - 2 columns
> b) find how the desired player "reads" ratings (eg, of 255, 0-20 = 1,
> 20-60 = 2 etc)
> c) convert my second XL column so that 1 = 10, 2 = 40 etc
> d) find what input format the desired player can take (csv, XL html(?)
> etc)
> e) convert my 2 columns to that format?
> 
imo, the main challenge still will be how to import the ratings (d) -
good luck finding a player capable of that (LMS+TrackStat can (using
XML), but I've yet to see anything similar anywhere else)
For file tags, a python script probably would be the simplest solution.
If you want to try this, start by installing python and understanding
how to install python modules (needed for the tagging bits later on)
Here's a test script which exports ratings for mp3s directly from the
LMS database as a csv file (adjust the paths in lines 4 and 5)
Note is also checks if the files can be accessed, which isn't required
now, but will be as soon as tags are written.

Code:

 
  import sqlite3, os, sys
  from urllib.parse import urlparse,urlunparse,unquote
  
  outfile="/tmp/lms-ratings.csv"
  sconn = sqlite3.connect( "persist.db")
  scursor = sconn.cursor()
  
  with open( outfile, 'w', encoding='utf-8') as fp:
scursor.execute("SELECT url, rating FROM track_statistics WHERE rating 
NOT NULL AND UPPER(url) LIKE '%.MP3' ORDER BY url")
for row in scursor:
fpath = unquote( urlparse( row[0]).path)
if not os.path.exists( fpath):
print("ERROR: file [{}] not found".format( fpath))
fp.write('"{}",{}\n'.format( fpath, row[1]))
  




SW: 'Web UI for LMS'
(http://forums.slimdevices.com/showthread.php?98186-Announce-Alternative-Web-Interface-(beta))
| 'Playlist Editor / Generator'
(http://forums.slimdevices.com/showthread.php?108199-Announce-LMS-Playlist-Editor)
| 'Music Classification'
(http://forums.slimdevices.com/showthread.php?108278-Announce-Essentia-Integration-music-classification-(moods-genres-))
| 'Similar Music'
(http://forums.slimdevices.com/showthread.php?108495-Announce-LMSmusly-play-similar-music)
| 'LMSlib2go' (https://www.nexus0.net/pub/sw/lmslib2go/)
HowTos: 'build a self-contained LMS'
(http://forums.slimdevices.com/showthread.php?99648-Howto-build-a-self-contained-LMS)
| 'Ogg Opus'
(http://forums.slimdevices.com/showthread.php?107011-Howto-play-Ogg-Opus-files)
| 'Bluetooth/ALSA'
(http://forums.slimdevices.com/showthread.php?107230-Howto-Bluetooth-streaming-to-from-LMS-(ALSA-only-no-PulseAudio))

Roland0's Profile: http://forums.slimdevices.com/member.php?userid=56808
View this thread: http://forums.slimdevices.com/showthread.php?t=108896

___
discuss mailing list
discuss@lists.slimdevices.com
http://lists.slimdevices.com/mailman/listinfo/discuss


Re: [slim] Ratings to files

2018-04-06 Thread DJanGo

Robbyell wrote: 
> 
> d) find what input format the desired player can take (csv, XL html(?)
> etc)
> e) convert my 2 columns to that format?
> 
> Am I on the right track?!

d) find a tag program, that runs with parameters (commandline)
e) write a script that
f) handle step: - swap all the %20s / %27s for spaces etc - and runs c)

g) forget about excel



DJanGo's Profile: http://forums.slimdevices.com/member.php?userid=1516
View this thread: http://forums.slimdevices.com/showthread.php?t=108896

___
discuss mailing list
discuss@lists.slimdevices.com
http://lists.slimdevices.com/mailman/listinfo/discuss


Re: [slim] Ratings to files

2018-04-02 Thread Roland0

Robbyell wrote: 
> ideally via the file (I understand there's s POPM field/tag within ID3v2
> which a few players understand).  
> 
Unfortunately, rating tags are a mess. Support of them is spotty and
inconsistent across players (which tag to use (e.g. not all use POPM
(which is for MP3 only, FLAC uses a different one)), and even if they
agree on the tag, the semantics of the tags are not standardized (e.g.
POPM has a range of 1-255, so it is up to the player to map ranges to
"stars" etc. LMS uses 0-100, so 0-20=* etc.))
The first thing to do would be therefore to check how the target player
handles this (if it supports it at all - most don't)

Robbyell wrote: 
> 
> I created the Excel version so that if LMS broke I still had my ratings,
> even if I can't get them into a music player.
> 

Bronx wrote: 
> 
> So do I - I fear the loss of my ratings due to the fact that trackstat
> is not maintained anymore, at least it seems so!
Ratings are built into LMS, so it's rather simple to export them
directly from the LMS database using any SQLite tool.

Robbyell wrote: 
> 
> Welcome other suggestions!
A simple solution is to create a playlist in LMS containing all >= 
tracks (e.g. using the SQL playlist plugin (which supports this out of
the box), or extgui4lms / LMS Playlist Editor (using a custom search)),
and copy the file to the target device (that's what I do for both my
phone and car)



SW: 'Web UI for LMS'
(http://forums.slimdevices.com/showthread.php?98186-Announce-Alternative-Web-Interface-(beta))
| 'Playlist Editor / Generator'
(http://forums.slimdevices.com/showthread.php?108199-Announce-LMS-Playlist-Editor)
| 'Music Classification'
(http://forums.slimdevices.com/showthread.php?108278-Announce-Essentia-Integration-music-classification-(moods-genres-))
| 'Similar Music'
(http://forums.slimdevices.com/showthread.php?108495-Announce-LMSmusly-play-similar-music)
| 'LMSlib2go' (https://www.nexus0.net/pub/sw/lmslib2go/)
HowTos: 'build a self-contained LMS'
(http://forums.slimdevices.com/showthread.php?99648-Howto-build-a-self-contained-LMS)
| 'Ogg Opus'
(http://forums.slimdevices.com/showthread.php?107011-Howto-play-Ogg-Opus-files)
| 'Bluetooth/ALSA'
(http://forums.slimdevices.com/showthread.php?107230-Howto-Bluetooth-streaming-to-from-LMS-(ALSA-only-no-PulseAudio))

Roland0's Profile: http://forums.slimdevices.com/member.php?userid=56808
View this thread: http://forums.slimdevices.com/showthread.php?t=108896

___
discuss mailing list
discuss@lists.slimdevices.com
http://lists.slimdevices.com/mailman/listinfo/discuss


Re: [slim] Ratings to files

2018-04-02 Thread Robbyell

Hmmm - no I'm not as IT literate as that!  My OS is Windows, and I just
about follow your suggestion, but not enough to risk trying it;)

Thanks anyway - were it simple enough, someone could make a few quid
writing a bit of software to pull ratings from one player to another,
ideally via the file (I understand there's s POPM field/tag within ID3v2
which a few players understand).  I created the Excel version so that if
LMS broke I still had my ratings, even if I can't get them into a music
player.

Welcome other suggestions!



Robbyell's Profile: http://forums.slimdevices.com/member.php?userid=64134
View this thread: http://forums.slimdevices.com/showthread.php?t=108896

___
discuss mailing list
discuss@lists.slimdevices.com
http://lists.slimdevices.com/mailman/listinfo/discuss


Re: [slim] Ratings to files

2018-04-02 Thread DJanGo

Hi,

looks like a pretty simple job, but it isnt simple.
eg Excel isnt a database (that statement alone tells me about your IT
Knowledge)

Since LMS never ever touches /changes tags only reads them - there is
IMHO no way to do that with a plugin. cause that would break the "never
change tags with lms behavior"
you need:


- A commandline tagger for your files and os. excel runs on osx and
  windows - not native on linux. you os is???
- A prefered tag to use (there are some to use)
- a csv file with your ratings nd your filepath/names
- some script that changes the tags for each filename with the
  ratings
- that script must check "if exist file then" cause some special chars
  in the lms db are not the real one -> " " is called %20 and so on
- some debugging
  

you see its not that simple as it looks on the first place but its not
impossible.



DJanGo's Profile: http://forums.slimdevices.com/member.php?userid=1516
View this thread: http://forums.slimdevices.com/showthread.php?t=108896

___
discuss mailing list
discuss@lists.slimdevices.com
http://lists.slimdevices.com/mailman/listinfo/discuss


Re: [slim] Ratings to files

2018-04-02 Thread Bronx

markm wrote: 
> Definitely interested in the answer to this!

So do I - I fear the loss of my ratings due to the fact that trackstat
is not maintained anymore, at least it seems so!



Bronx's Profile: http://forums.slimdevices.com/member.php?userid=33115
View this thread: http://forums.slimdevices.com/showthread.php?t=108896

___
discuss mailing list
discuss@lists.slimdevices.com
http://lists.slimdevices.com/mailman/listinfo/discuss


Re: [slim] Ratings to files

2018-04-02 Thread markm9999

Definitely interested in the answer to this!



*Player: *1 x Transporter w/Trans-knob, 2 x Touch (Active, 3 x Spares),
4 x Boom (Active, 9 x Spares)
*Server: *1 x Win Server (ESXi 6.x) w/LMS, 1 x HP 24" Touch Screen PC
w/LMS & SqueezePlay
*Control: *4 x w/iPeng, 1 x Samsung Note 4, 3ea x Fire 7", 8” tablets, 1
x 10" all w/SqueezeCtrl & Player (Angry Goat)
*Audio: *Mark Levinson 23.5 Amp, 380s Pre, 390s CD, B&W 801 II, Acoustic
Energy AE-2 signature, SOTA Sapphire table

Computer geek/tech hoarder(!), and DAMN I love the LMS/Squeeze
infrastructure!

markm's Profile: http://forums.slimdevices.com/member.php?userid=65015
View this thread: http://forums.slimdevices.com/showthread.php?t=108896

___
discuss mailing list
discuss@lists.slimdevices.com
http://lists.slimdevices.com/mailman/listinfo/discuss