Hi (again) !
Le Saturday 09 August 2008 12:05:50 Matej Nastran, vous avez écrit :
> I use the following code to add at least filename to metadata if there
> is no ID3 tag in mp3 file.
> ----------
> pattern = '$(if $(title),"$(title)","$(filename) (FN)")'
> radio = rewrite_metadata([("title", pattern),
> ("comment","http://studiosvetilnik.net")],radio)
> ----------
>
> I tried to use basename (so not the entire path would be displayed) but
> unsuccessfully.
>
> Any hint how to do it?
Yes, it's highly possible that the pattern environment doesn't allow the use
of functions from the language, or perhaps core functions.
You can look at map_metadata which is now the main function for rewriting
metadata. rewrite_metadata is now written using this one in utils.liq:
def rewrite_metadata(l,~insert_missing=true,
~update=true,~strip=false,
s)
# We don't need to return all values, since
# map_metadata only update returned values.
# So, we simply apply all rewrite rules !
def map(m)
def apply(x)
label = fst(x)
value = snd(x)
(label,value % m)
end
list.map(apply,l)
end
map_metadata(map,insert_missing=insert_missing,
update=update,strip=strip,s)
end
Romain
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Savonet-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/savonet-users