![]() |
Puppy.SendMp3sToToppy HistoryHide minor edits - Show changes to markup October 01, 2005, at 11:28 AM
by -- updated to reflect Puppy\'s new turbo behaviour
Changed lines 37-38 from:
to:
puppy -c turbo 1 Changed lines 40-41 from:
puppy -t -c mkdir \\MP3\\"$the_dir" to:
puppy -c mkdir \\MP3\\"$the_dir" Changed line 46 from:
puppy -t -c put "$file" \\MP3\\"$the_dir"\\"$this_file"; to:
puppy -c put "$file" \\MP3\\"$the_dir"\\"$this_file"; Added lines 50-52:
puppy -c turbo 0 June 21, 2005, at 02:10 AM
by --
Deleted lines 3-4:
Changed lines 6-7 from:
to:
(:table border=0 width=100% bgcolor=#eeffee:) (:cell:) Changed lines 10-11 from:
# create a directory of the same name on the Topfield (in the Topfield's \MP3? directory)
# copy all of the mp3s from the source directory to the new directory on the Topfield
to:
# create a directory of the same name on the Topfield (in the Topfield's \MP3 directory) # copy all of the MP3s from the source directory to the new directory on the Topfield Changed lines 38-40 from:
echo "making a directory called \\Mp3\\"$the_dir" (on the Topfield)"
puppy -t -c mkdir \\MP3?\\"$the_dir"
to:
echo "making a directory called \\Mp3\\"$the_dir" (on the Topfield)" puppy -t -c mkdir \\MP3\\"$the_dir" Changed line 45 from:
to:
puppy -t -c put "$file" \\MP3\\"$the_dir"\\"$this_file"; Changed lines 49-50 from:
to:
(:tableend:) Changed lines 55-56 from:
to:
(:table border=0 width=100% bgcolor=#eeffee:) (:cell:) Changed line 61 from:
to:
# This script copies *.mp3 files to a Topfield 5000 PVRt Changed line 63 from:
to:
# Set Dirmp3Src to your mp3 source directory Changed line 77 from:
to:
# of 128 folders in each; e.g. under MP3 "MP3/Artists A to M" and "MP3/Artists N to Z" Changed line 103 from:
to:
# After copying all the MP3s to the PVR, you should restart the PVR. It looks Changed line 113 from:
# start copying mp3 files from here - typically this is a Linux/Windows remote share to:
# start copying MP3 files from here - typically this is a Linux/Windows remote share Changed lines 115-116 from:
to:
Dirmp3Src=/root/P4 Changed lines 118-123 from:
# always be MP3? to suit jukebox TAPs? # we'll keep count of how many mp3 files are copied mp3count=0 to:
# always be MP3 to suit jukebox TAPs Dirmp3Dest=MP3 # we'll keep count of how many MP3 files are copied mp3count=0 Changed lines 125-127 from:
to:
StartTime=`date` StopTime= Changed lines 131-132 from:
if [ -d "$Dirmp3Src" ] then to:
if [ -d "$Dirmp3Src" ] then Changed line 136 from:
else to:
else Changed lines 139-140 from:
fi to:
fi Changed lines 144-149 from:
artistCount=0 echo "Counting number of Artist directories - please wait ..." for file in $Dirmp3Src/* do to:
artistCount=0 echo "Counting number of Artist directories - please wait ..." for file in $Dirmp3Src/* do Changed lines 153-154 from:
done to:
done Changed lines 166-167 from:
if [ $? -ne 0 ]; then echo "ERROR detected by $0: Topfield PVR not turned on OR busy OR could not make directory"; exit 1; fi to:
if [ $? -ne 0 ]; then echo "ERROR detected by $0: " \
"Topfield PVR not turned on OR busy OR could not make directory"; exit 1; fi
Changed lines 172-173 from:
for file in $Dirmp3Src/* do to:
for file in $Dirmp3Src/* do Changed line 176 from:
to:
DirArtist=`basename "$file"` Changed line 187 from:
to:
DirAlbum=`basename "$file"` Changed lines 198-199 from:
puppy -t -q -c put "$Dirmp3Src/$DirArtist/$DirAlbum/$mp3File" "$Dirmp3Dest\\$DirArtist\\$DirAlbum\\$mp3File" to:
puppy -t -q -c put "$Dirmp3Src/$DirArtist/$DirAlbum/$mp3File" \
"$Dirmp3Dest\\$DirArtist\\$DirAlbum\\$mp3File"
Changed lines 205-206 from:
done to:
done StopTime=`date` Deleted line 213:
Changed line 215 from:
echo "mp3 files copied : $mp3count" to:
echo "MP3 files copied : $mp3count" Changed lines 220-222 from:
to:
(:tableend:) June 09, 2005, at 09:28 PM
by --
Changed lines 124-126 from:
to:
June 09, 2005, at 11:02 AM
by --
Changed line 80 from:
# sort it all out later using ftpd-topfield - probably the prferred method. You could to:
# sort it all out later using ftpd-topfield - probably the preferred method. You could June 09, 2005, at 11:00 AM
by --
Changed line 60 from:
to:
June 09, 2005, at 10:59 AM
by --
Changed lines 206-221 from:
echo "" echo "Done!" echo "Start time : $StartTime" echo "Stop time : $StopTime" echo "mp3 files copied : $mp3count" echo "" exit 0 to:
June 09, 2005, at 10:58 AM
by --
Added line 207:
Added line 209:
Added line 211:
Added line 213:
Added line 215:
Added line 217:
June 09, 2005, at 08:10 AM
by --
Changed lines 56-113 from:
to:
#!/bin/sh # cpmp3tf.sh - should be runnable using any old path # This script copies *.mp3 files to a Topfield 500 PVRt? # It creates all directories as needed on the PVR # Set Dirmp3Src? to your mp3 source directory # Script assumes a "..\artist\album\song" layout # Empty directories are still created at the PVR # files in upper level directories, ie not in an album directory, are ignored # Only files with an mp3 extension are copied # 25 GB of data takes about 12 hours to copy over to the Topfield! # Some other limitations: # 1) The Toppy application only all allows 128 directory and/or files per directory # Programs accessing the Toppy via the USB interface will allow more to be created # but the actual Toppy application will have a heart attack. To overcome this, you # can put groups of artists under additional directories, all containing a maximum # of 128 folders in each; e.g. under MP3? "MP3?/Artists A to M" and "MP3?/Artists N to Z" # An exception here is the directory "Various artists" - it may exceed the 128 maximum # and this isn't checked for. Currently the script will not execute if more 128 artists # are found. You could comment this code out, then copy all the mp3s over and then # sort it all out later using ftpd-topfield - probably the prferred method. You could # use ftpd-topfield to do all the copying but this script perhaps has the advantage # that it will keep going even if say some USB error occurs. # 2) mp3 files that have accented characters in their filename may cause problems on # that file e.g. Clannard's Celtic Collection. # 3) Currently puppy doesn't return an appropriate error return status for this script # so the on Error exits don't work - not really a big problem # 4) because puppy cannot indicate if a directory already exists, this script should # be run only once. A second run will result in heaps of error msgs being shown as # puppy tries to create pre existing directories. # Possible improvements: # 1) It would be useful to change this code so that any error msgs from puppy were # sent to a text file. # 2) Artists with "The" in their name all get sorted together. It may be a good idea # to mod this script to remove these prefixes from the file name except for the artist # "The The"! # After copying all the MP3s? to the PVR, you should restart the PVR. It looks # like the directory layout may be loaded at start up by the Toppy app and # therefore needs to be refreshed. # If altering this script; beware of spaces in directory/filenames # some code could be replaced with ls -d but its results are bit # weird if used on the working directory so was avoided #--------------------------------------------------- # start copying mp3 files from here - typically this is a Linux/Windows remote share # Typically P4 (this is a Pentium 4 in my case) would be mapped to say C:/Music on the share Changed lines 116-117 from:
to:
# destination directory on the Topfield PVR - it's created and should # always be MP3? to suit jukebox TAPs? Changed line 120 from:
to:
# we'll keep count of how many mp3 files are copied Changed line 123 from:
to:
# also the start and stop time Changed lines 127-129 from:
to:
#--------------------------------------------------- # got a valid mp3 source directory? Changed lines 140-142 from:
to:
#--------------------------------------------------- # count the number of artists Changed line 154 from:
to:
# do the artist count Changed lines 161-162 from:
to:
#--------------------------------------------------- Changed lines 167-169 from:
to:
#--------------------------------------------------- # loop through all the artists and create the corresponding destination directory Changed lines 204-205 from:
to:
#--------------------------------------------------- Changed lines 216-219 from:
to:
#--------------------------------------------------- June 09, 2005, at 08:07 AM
by -- Another mp3 copy script
Added lines 50-219:
Here is another mp3 copy script:
mp3count=0
if [ -d "$Dirmp3Src" ] then echo "Source directory is : $Dirmp3Src" echo -e "Destination directory is : \\$Dirmp3Dest" echo "" else echo "ERROR detected by $0: mp3 source directory $Dirmp3Src does not exist" exit 1 fi
artistCount=0 echo "Counting number of Artist directories - please wait ..." for file in $Dirmp3Src/* do if ! [ -d "$file" ]; then continue; fi artistCount=`expr $artistCount + 1` done
echo "Creating Topfield 5000PVRt directory: \\$Dirmp3Dest" puppy -t -c mkdir \\"$Dirmp3Dest" if [ $? -ne 0 ]; then echo "ERROR detected by $0: Topfield PVR not turned on OR busy OR could not make directory"; exit 1; fi
for file in $Dirmp3Src/* do if ! [ -d "$file" ]; then continue; fi DirArtist?=`basename "$file"` echo "Creating Topfield PVR directory: \\..\\$DirArtist" puppy -t -c mkdir "\\$Dirmp3Dest\\$DirArtist" if [ $? -ne 0 ]; then echo "ERROR detected by $0: could not make directory"; exit 1; fi # loop through all the albums and create the corresponding destination directory for file in "$Dirmp3Src/$DirArtist"/* do if ! [ -d "$file" ]; then continue; fi DirAlbum?=`basename "$file"` echo -e "\tCreating Topfield PVR directory: \\..\\..\\$DirAlbum" puppy -t -c mkdir "\\$Dirmp3Dest\\$DirArtist\\$DirAlbum" if [ $? -ne 0 ]; then echo "ERROR detected by $0: could not make directory"; exit 1; fi # copy the mp3s to the PVR for mp3File in "$Dirmp3Src/$DirArtist/$DirAlbum/"*.mp3 do mp3File=`basename "$mp3File"` echo -e "\t\tCopying track: $mp3File" puppy -t -q -c put "$Dirmp3Src/$DirArtist/$DirAlbum/$mp3File" "$Dirmp3Dest\\$DirArtist\\$DirAlbum\\$mp3File" if [ $? -ne 0 ]; then echo "ERROR detected by $0: could not copy mp3 file"; exit 1; fi mp3count=`expr $mp3count + 1` done done done
echo "" echo "Done!" echo "Start time : $StartTime" StopTime?=`date` echo "Stop time : $StopTime" echo "mp3 files copied : $mp3count" echo "" exit 0
March 28, 2005, at 09:22 AM
by --
Changed lines 1-49 from:
Describe SendMp3sToToppy here. to:
The following is a script that I use to quickly transfer music from a Linux PC to the Topfield 5000 PVR. It uses Puppy to 'copy' a specified directory, and all of its mp3 files, to the Topfield. Warnings: I Am Not A Programmer. This script does very little error checking. #!/bin/bash # specify a source directory and this script will: # create a directory of the same name on the Topfield (in the Topfield's \MP3? directory) # copy all of the mp3s from the source directory to the new directory on the Topfield # # e.g. usage: send_mp3s_to_toppy.sh /home/rik/music/various_artists/trainspotting # # WARNING: use at your own risk. IANAP! # if [ $# != 1 ]; then echo "ERROR: Please specify the directory to send to the Topfield" 1>&2 echo "Usage: send_mp3s_to_toppy directory" 1>&2 exit 1 fi if [ ! -d "$1" ]; then echo "ERROR: $1 does not seem to be a directory" 1>&2 echo "Usage: send_mp3s_to_toppy directory" 1>&2 exit 1 else dir="$1" fi echo "------------- Copying $dir to the Topfield..." the_dir=`basename "$dir"` echo "making a directory called \\Mp3\\"$the_dir" (on the Topfield)" puppy -t -c mkdir \\MP3?\\"$the_dir" for file in "$dir"/*.mp3; do this_file=`basename "$file"` echo echo "------------- PROCESSING $this_file"; puppy -t -c put "$file" \\MP3?\\"$the_dir"\\"$this_file"; echo "------------- FINISHED $this_file"; echo done |