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