IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
short question about foo-script, how to get cover art
seaeye
post Apr 2 2007, 18:38
Post #1





Group: Members
Posts: 64
Joined: 3-October 01
Member No.: 181



hi guys.
pardon a lame question about scripting, but i've just started. I want to touch on of the exisitng .pui files and adjust the source of cover files.

the logic is as follows:
- if there's a JPG file in the parent dir, where files are stored, grab it;
- else search in a fixed location a JPG file, which name starts with the name of the album played.

something like...

CODE
$setpvar(coverartsrc,
$if($fileexists($replace(%path%,%filename_ext%,*.jpg)),
$replace(%path%,%filename_ext%,*.jpg),
C:/covers/%album%*.jpg
)
)


but it doesn;t work properly. what am i missing here?
thanks!
Go to the top of the page
+Quote Post
Yotsuya
post Apr 3 2007, 00:21
Post #2





Group: Members
Posts: 1535
Joined: 8-May 06
Member No.: 30546



Try something like this:
CODE
// PerTrack
$puts(coverartsrc,$replace(%path%,%filename_ext%.*.jpg))

$setpvar(coverartsrc,$if($fileexists($get(coverartsrc)),$get(coverartsrc),
c:\covers\%album%*.jpg
))


I don't really see a problem with the code you pasted unless it is not under a // PerTrack or // PerSecond header. Also, I assume by your example that by "parent dir" you are referring to the directory that the song file resides in. If you actually mean the parent directory 1 level higher, replace "%filename_ext%" with "%directory%\%filename_ext%". Also there is support for wildcard extensions so you can replace ".jpg" with ".*" and the code will automatically search for .gif, .png, etc.

This post has been edited by Yotsuya: Apr 3 2007, 00:29


--------------------
http://www.ubuntu.com
Go to the top of the page
+Quote Post
seaeye
post Apr 5 2007, 21:45
Post #3





Group: Members
Posts: 64
Joined: 3-October 01
Member No.: 181



thanks a lot for the reply. i'm slowly figuring it out...
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 22nd September 2014 - 04:28