Header-Panorama

I use my Sansa players as my daily music companions, but also as a DJ-ing backup if something goes wrong with the normal hardware. Since I could not find a good solution for keeping the files in sync with my computer, I wrote my own python script that does it for me.

Specifically, I wanted to achieve 3 things:
 1. Copy playlists (e.g. the evenings dancing playlist as a backup) to the player itself, but avoiding copying files that are already present to speed up the process.
 2. Regularly copy and update ther music that I listen to on the go on the SD card (similar to winamps "AUTOFILL"), but avoiding duplicates on player and SD card, which will show up as duplicates in the database.  
 3. All of this for my Linux music player (clementine), which does not support a direct transfer of playlists.
 

The downloadable script (below) allows this by doing the following.

WHAT IT DOES:

The python script allows to transfer M3U-Playlists from a computer to an mp3 player or its internal SD card. In the process, the required music files are copied from THE COMPUTER to THE PLAYER or the SD card, and then a playlist is created ON THE PLAYER that points to these files.

DETAILS:
The Transfer.py is in the root of my player.
Before anything, I simply export the playlists I want to transfer with clementine to m3u.


To do a full update I do step 1 and 2, to just do some autofill with new music, I delete some and run step 2.
 1. I use Transfer.py <Playlists> on all the playlists that I want to have available for the DJ-ing (and which pretty much never change)
 2. I use Transfer.py -SD -FILL <Path/to/Playlist/>/Autofill.m3u , , where Autofill is a playlist designed to contain all files in my library (actually those I like better occur more often to increase their chance of being transfered).

 


 
CAVEEATS:
  - I use the "/" as the path-delimiter, so this script is limited to Linux and Mac (untested). In principle, however, it should be easy to fix this, since python has some libraries that allow you to deal with paths more generally.
  - Files are all stored in one folder on the player or SD, and I compare filenames only to determine if that file is already present when copying a new one. If you have files that have the same name but come from different folders (e.g. two files: Interpret1/Track1.mp3 and Interpret2/Track1.mp3), then this is a match. Again, if you want to, feel free to implement a more intelligent matching criterion (or name your music differently).

 

However, before jumping into it:

WARNING: I designed this program solely for my own use, so it does what I want, but i did not take the time to include all kinds of plausability checks for input etc.
 Despite my best intention the script may therefore delete files or otherwise mess up your computer, so use carefully and maybe take the time to understand it a bit better.
 I am always open to suggestions for improvements, though.

LICENSE: GPL v3.0
  This program is free software: you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation, either version 3 of the License, or
  (at your option) any later version.
  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.
  You should have received a copy of the GNU General Public License
  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 

Download the Music Transfer

 

 

We use cookies

We use cookies on our website. Some of them are essential for the operation of the site, while others help us to improve this site and the user experience (tracking cookies). You can decide for yourself whether you want to allow cookies or not. Please note that if you reject them, you may not be able to use all the functionalities of the site.