Author Topic: "Unknown Field" Question  (Read 1629 times)

velveteenelahrairah

  • Newbie
  • *
  • Posts: 9
When playing my music I like to have its data displayed as <Title> · <Artist> · <Album> · <Grouping> · <Keywords> · <Playlist>. However this results in a whole bunch of "Unknown Grouping" · "Unknown Keywords" · "Unknown Playlist" in the title bar and task bar. (Eg. #3 · Aphex Twin · Syro · Rotation · Unknown Keywords · Unknown Playlist) How can I make them not appear when the field is blank?

I have a similar setup in the mini player and there I've found the $IsNull workaround for the problem, which unfortunately leaves me with an annoying trailing · at the end when only one of the categories is used - eg. Rotation · TV · Person Of Interest will display fine without the trailing separator, but another song will display as Rotation · or Rotation · Theatre ·. Is it possible to have blank fields display just as blank rather than "Unknown ##" and to hide the separator when necessary? Thanks!

hiccup

  • Sr. Member
  • ****
  • Posts: 7884
Couldn't you add the middle dot to the string if populated?:
$IsNull(<Grouping>,," · "<Grouping>)

velveteenelahrairah

  • Newbie
  • *
  • Posts: 9
Couldn't you add the middle dot to the string if populated?:
$IsNull(<Grouping>,," · "<Grouping>)


Hi, thanks - just tried that and it merely moves the interpunct to the beginning ( · Rotation). I just want to know whether I can set it as a "separator" somehow so it can be ignored when the field is blank.

ED I need more coffee. Apparently the solution is to add it to the beginning of the middle field (Keywords) and the last field (Playlists). So thank you, that really helped!!

ED 2 - Except I still get the trailing dot when the first field is missing - so a song not in rotation with keywords and in a playlist will show as · TV · Fringe. Agh. Oh well, it's a step forward!
Last Edit: October 18, 2019, 08:21:19 AM by velveteenelahrairah

hiccup

  • Sr. Member
  • ****
  • Posts: 7884
The only occasion where you would still get a leading middle-dot using this solution is if the artist tag is blank. But that will probably never happen here.

velveteenelahrairah

  • Newbie
  • *
  • Posts: 9
The only occasion where you would still get a leading middle-dot using this solution is if the artist tag is blank. But that will probably never happen here.

I have the tags set up as Title on top, Artist · Album underneath, then Grouping · Keywords · Playlist on the third line and Love on the fourth. So this workaround works when I only have a track on Rotation, but falls apart when I have something with no Grouping but Keywords and Playlist. So a song I have keyworded as TV and added to the Person of Interest playlist but isn't in the rotation will still show up as

Too Marvelous For Words
Frank Sinatra · Nothing But The Best 
 · TV · Person Of Interest 

instead of just 
Too Marvelous For Words 
Frank Sinatra · Nothing But The Best
TV · Person Of Interest.

hiccup

  • Sr. Member
  • ****
  • Posts: 7884
ED 2 - Except I still get the trailing dot when the first field is missing - so a song not in rotation with keywords and in a playlist will show as · TV ·

I can think of two ways to address this. (And maybe combine them a bit)

You could make use of something like this that only writes a middle dot depending on if any of these two tags have a value:
$IsNull(<Keywords><Playlists>,," · ")

And/or you could do a lot of nesting.
You could try and find some examples on the forum.
If you don't succeed, post an example of how far you got, and me or somebody else can try to tweak/improve it.
(but that's not going to be me today)

velveteenelahrairah

  • Newbie
  • *
  • Posts: 9
All right, I'll try that! Thank you so much for your help, and I'm sorry I'm such a nitpicky pain in the ass haha

velveteenelahrairah

  • Newbie
  • *
  • Posts: 9
Update : I just said "fuck it" and created "Separator" tags in my music files (GroupSep, KeySep and ListSep). Now all I need to do is copy the · to the relevant field when needed and call it good. It's not perfect, but it does the job!

Son Of Update: ALL SORTED!

Code in case anyone else wants it:

First, create three new Custom Tags in Tags (1) - ListSep, GroupSep, and KeySep.

In each tag field in the main menu add • according to whether you have a playlist, a grouping and/or keywords to separate. So eg if you have a grouping but no playlist or keywords you only add the dot to GroupSep, if you have a playlist and keywords you add it to ListSep and KeySep, etc.

Then create a new Grouping • Keywords • Playlist virtual tag.

In the Formula area, add

$IsNull(<Grouping>,,<Grouping>)$IsNull(<KeySep>,," "<KeySep>)$IsNull(<Keywords>,," "<Keywords>)$IsNull(<ListSep>,," "<ListSep>)$IsNull(<Playlist>,," "<Playlist>)

Then a second new Virtual Tag, Artist • Album with formula

<Artist> • <Album>

Then hit the Now Playing tab and in Show In Taskbar As, add

<Title> • <Artist> • <Album>$IsNull(<GroupSep>,," "<GroupSep>)$IsNull(<Grouping>,," "<Grouping>)$IsNull(<KeySep>,," "<KeySep>)$IsNull(<Keywords>,," "<Keywords>)$IsNull(<ListSep>,," "<ListSep>)$IsNull(<Playlist>,," "<Playlist>)

Then Layout (1), Top Panel, Main Player. Make sure it has 2 lines.  

First line, add

<Title>

Second line, add

<Artist> • <Album>$IsNull(<GroupSep>,," "<GroupSep>)$IsNull(<Grouping>,," "<Grouping>)$IsNull(<KeySep>,," "<KeySep>)$IsNull(<Keywords>,," "<Keywords>)$IsNull(<ListSep>,," "<ListSep>)$IsNull(<Playlist>,," "<Playlist>)

Finally go to the Mini player , Panel Layout, Customise Panel

Select Title as the first display field, Artist • Album as the second, and Grouping • Keywords • Playlist as the third (optionally tick the Show Last.fm "Love" track button - I use it to mark new music I like for later organisation.)

(I have yet to figure out how to get rid of the trailing • when there is no grouping, though. Which is quite annoying. Oh well.)

All done!








How the top player bar looks now:



And the pain in the ass that I can't seem to fix circled in red:



Will play around with Custom Tags some more, maybe I'll fix it!

Revenge Of ETA - Fixed!



New code:

Needed to add an Extra Tag in the Custom Tags named ExtrasSep (once again, holding a • when needed) and muck around with the spacing.

So now the Grouping • Keywords • Playlist code is

$IsNull(<Grouping>,,<Grouping>" ")$IsNull(<KeySep>,,<KeySep>" ")$IsNull(<Keywords>,,<Keywords>)$IsNull(<ListSep>,,<ListSep>)$IsNull(<Playlist>,," "<Playlist>)

and the Main Player code is

<Artist> • <Album>$IsNull(<GroupSep>,," "<GroupSep>)$IsNull(<ExtrasSep>,," "<ExtrasSep>)$IsNull(<Grouping>,," "<Grouping>)$IsNull(<KeySep>,," "<KeySep>)$IsNull(<Keywords>,," "<Keywords>)$IsNull(<ListSep>,," "<ListSep>)$IsNull(<Playlist>,," "<Playlist>)

... PHEW.

The code looks like spaghetti after a kitten has played in it, but it works. Hedgie OUT.
Last Edit: October 18, 2019, 08:01:32 PM by velveteenelahrairah

hiccup

  • Sr. Member
  • ****
  • Posts: 7884
Wow, you really put some effort in this.
Well done and thanks for sharing.

Just in case it is still useful to you (or others perhaps), here is what my formula would look like if I have three different tags, and want them displayed with separators depending on the presence of each tag:

$IsNull(<Tag1>,,<Tag1>)$IsNull(<Tag1>,$IsNull(<Tag2>,,<Tag2>),$IsNull(<Tag2>,," · "<Tag2>))$IsNull(<Tag1><Tag2>,$IsNull(<Tag3>,,<Tag3>),$IsNull(<Tag3>,," · "<Tag3>))




edit:
This one works too and is probably better. It's a little bit easier to see how it works, and it's a more suitable approach in case you want to extend it to use more than three tags:

$IsNull(<Tag1>,,<Tag1>)$IsNull(<Tag1>,,$IsNull(<Tag2>,," · "))$IsNull(<Tag2>,,<Tag2>)$IsNull(<Tag1><Tag2>,,$IsNull(<Tag3>,," · "))$IsNull(<Tag3>,,<Tag3>)
Last Edit: October 19, 2019, 08:35:32 AM by hiccup

velveteenelahrairah

  • Newbie
  • *
  • Posts: 9
I just gave that code a little go, and the end results are these:

Title Code:

<Artist> • <Album>$IsNull(<Album>,,$IsNull(<Grouping>,," • "))$IsNull(<Grouping>,,<Grouping>)$IsNull(<Album><Grouping>,,$IsNull(<Keywords>,," • ")$IsNull(<Keywords>,,<Keywords>)$IsNull(<Playlist>,," • "))$IsNull(<Playlist>,,<Playlist>)

Virtual Tag Code:

$IsNull(<Grouping>,,<Grouping>)$IsNull(<Grouping>,,$IsNull(<Keywords>,," • "))$IsNull(<Keywords>,,<Keywords>)$IsNull(<Grouping><Keywords>,,$IsNull(<Playlist>,," • "))$IsNull(<Playlist>,,<Playlist>)

Task Bar / Scroll In Player Code:

<Title> • <Artist> • <Album>$IsNull(<Album>,,$IsNull(<Grouping>,," • "))$IsNull(<Grouping>,,<Grouping>)$IsNull(<Album><Grouping>,,$IsNull(<Keywords>,," • ")$IsNull(<Keywords>,,<Keywords>)$IsNull(<Playlist>,," • "))$IsNull(<Playlist>,,<Playlist>)


Much neater than my little kludge and no need to waste custom tags on freaking dots, so thank you very much!