Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: wanted: workaround for %title% fallback to %_filename% (Read 1074 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

wanted: workaround for %title% fallback to %_filename%

I've found myself in a situation where I need to be able to tell exactly what files actually contain tags, generally but in particular a %title% tag.

What I want is for the %title% column to indicate that the tag is not present instead of falling back to the %_filename%; I need some files to end up completely tagless to avoid issues with a quirky hardware player and in many cases the existing %title% tag is the same as the filename so the fallback behaviour makes it ambiguous as to what's actually displaying as there's no difference between them.
This is complicated by the fact that the %title% tag falls back to the filename when the tag is not present.
When I try to do anything logical with %title% such as $strcmp it to %_filename% (that should be the filename without extension, right?) the results are useless either because of the fallback behaviour or (I digress) me not understanding how to use it properly.
I tried using the tag scripting primer to work around this but I think I'm too distracted to grasp anything like coding right now.
I feel like I'm missing something really obvious here. Can anyone tell me the correct display script so that:

when %title% is present it displays the title;
when %title% is not present, display "NO TITLE TAG" or even a blank **rather than falling back to %_filename%**

p.s. it makes sense to ask why I'm bothering to do this but I'm talking about thousands of files - being selective about what should actually have tags removed will save a large amount of time (rather than attempting "remove tags" on everything which would take a productivity-ruining length of time to run through everything that *already is tagless* because it doesn't check whether there's a tag there before trying to remove it and rewrites the entire stream+empty headers/footers regardless, literally going through the process (and I/O) of creating a whole new copy and deleting the old one for no actual reason besides strict literalism)

Re: wanted: workaround for %title% fallback to %_filename%

Reply #1
$meta(title)

 

Re: wanted: workaround for %title% fallback to %_filename%

Reply #2
Here's some ideas for you.
I replaced the default Playlist "Playing" column with a custom one. It displays a dot next to the playing track instead of an arrow. If a track has title info, it displays nothing for a non-playing track, but for a track with no title info it displays a couple of dots to indicate I'm seeing the file name, rather than the title.
I have highlighting enabled in Preferences/Display/Default User Interface/Colors and Fonts, hence >>><<< for highlighting.

$puts(PLAYING1,$if(%isplaying%,>>>•<<<,··))$puts(PLAYING2,$if(%isplaying%,>>>=<<<))[$ifequal($meta_num(title),0,$get(PLAYING1),$get(PLAYING2))]

For a "Title" column, you could do something like displaying the file name with the extension so you know it's a file name, and/or use highlighting and/or add text.
$if(%filename%,$ifequal($meta_num(title),0,<NO TITLE TAG>  >%filename_ext%<,%title%))