Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
xmms-plugins für USB-stick
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German)
View previous topic :: View next topic  
Author Message
dr.socke
n00b
n00b


Joined: 17 Nov 2004
Posts: 21

PostPosted: Thu Mar 17, 2005 6:17 pm    Post subject: xmms-plugins für USB-stick Reply with quote

tach auch erstma alle zusammen,

ich hätt da man ne frage: gibt es für xmms son plugin womit man wie in winamp seine playlist einfach auf den usbstick zieht und er da denn die entsprechenden titel raufschreibt (nützt mir ja nix, wenn er nur die playlist darauf malt, ich will ja die mp3s haben)
also ich kann ja unter xmms playlists erstellen, bloß wie sag ich ihm, das er die titel einer playlist auf den stick kopieren soll.
die alle zusammen zusuchen is n bissel mühsehlig, und ich hab mir gedacht, vielleicht gehts auch einfacher...

wenn einer was weis...immer raus damit
:D
Back to top
View user's profile Send private message
/dev/blackhawk
Guru
Guru


Joined: 12 Feb 2004
Posts: 380
Location: Germany

PostPosted: Thu Mar 17, 2005 7:24 pm    Post subject: Reply with quote

Hab mir grad mal die Playlist-File angeschaut (.m3u) und dabei ist mir aufgefallen, dass da der exakte Pfad der einzelnen Musik-Files drin steht. Ein kleines Skript, dass die Playlist ausliest, Zeilen mit einem '#' an Anfang ignoriert und die restlichen Titel dann kopiert, sollte reichen.

Edit:

@'jeden der Bash-Scripting kann':
Die .m3u files sind alle nach einem bestimmten Schema aufgebaut:
z.B.
Code:
#EXTINF:270,Bon Jovi - Queen Of New Orleans.mp3
/MP3s/Bon Jovi - Queen Of New Orleans.mp3

irgendwas in der Art
Code:
for i in `cat /home/xyz/Playlist.m3u`;do cp $i /tmp/;done
müsste eigentlich reichen. Es fehlt eigentlich nur noch die Änderungen, dass Zeilen mit einem '#' am Anfang ignoriert werden und eine Zeile als ein Item angesehen wird.
Da ich mich mit Bash-Skripte nicht sonderlich gut auskenne, die Bitte an die Dev's - oder jeden anderen der einen Lösungsvorschlag hat - das Skript zu vervollständigen. :wink:



MFG

/dev/blackhawk
Back to top
View user's profile Send private message
/dev/blackhawk
Guru
Guru


Joined: 12 Feb 2004
Posts: 380
Location: Germany

PostPosted: Fri Mar 18, 2005 6:43 pm    Post subject: Reply with quote

Da irgendwie doch keiner auf die schnelle was parat hat, hab ich selber mal ein bißchen rumprobiert. Sieht zwar arg zusammen geschustert aus, aber es scheint zu funktionieren :wink:

Code:
#!/bin/sh

#################################################################
#Usage:                                                         #
# #list2stick /<Pfad-zur-Liste>/<Liste.m3u> /<Ziel-Ordner>/     #
#################################################################

LIST=$1
DESTINATION=$2

cat $LIST | grep -v '#' > /tmp/mp3list
while read LINE
do
   cp "$LINE" $DESTINATION

done < /tmp/mp3list
rm /tmp/mp3list


MFG

/dev/blackhawk
Back to top
View user's profile Send private message
Anarcho
Advocate
Advocate


Joined: 06 Jun 2004
Posts: 2970
Location: Germany

PostPosted: Fri Mar 18, 2005 7:28 pm    Post subject: Reply with quote

OK, OK,...

So, mit Fehlerbehandlung und ohne temp-file!

Code:
#!/bin/sh

#################################################################
#Usage:                                                         #
# #list2stick /<Pfad-zur-Liste>/<Liste.m3u> /<Ziel-Ordner>/     #
#################################################################

if [ "$#" -lt 2 -o ! -f "$1" -o ! -d "$2" ]; then
   echo "$0 <file.m3u> <destination folder>"
   exit 1;
fi

grep -v '#' $1 | while read LINE; do
   echo "copy \"$LINE\" to $2"
   cp "$LINE" $2
done

_________________
...it's only Rock'n'Roll, but I like it!
Back to top
View user's profile Send private message
/dev/blackhawk
Guru
Guru


Joined: 12 Feb 2004
Posts: 380
Location: Germany

PostPosted: Fri Mar 18, 2005 11:47 pm    Post subject: Reply with quote

Perfekt! Ich danke Dir!

@dr.socke: Somit [SOLVED] oder?!?

MFG

/dev/blackhawk
Back to top
View user's profile Send private message
dr.socke
n00b
n00b


Joined: 17 Nov 2004
Posts: 21

PostPosted: Sat Mar 19, 2005 12:28 pm    Post subject: Reply with quote

Jo, danke, das passt!!

vielleicht ham die von der xmms-entwicklung ja mal die zeit, und baun das da denn irgendwie mit ein, nur so für die leutz, die nich so viel mit scripten anfangen können.

Aber fettes Dankeschön, wieder eine sorge weniger.... :D
Back to top
View user's profile Send private message
Anarcho
Advocate
Advocate


Joined: 06 Jun 2004
Posts: 2970
Location: Germany

PostPosted: Sat Mar 19, 2005 1:10 pm    Post subject: Reply with quote

/dev/blackhawk wrote:
Perfekt! Ich danke Dir!


Kein problem, dafür bin ich ja da...(irgendwie muss man sein Studium ja rechtfertigen)
_________________
...it's only Rock'n'Roll, but I like it!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum