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: using MISSING not in a query: is it possible? (Read 2336 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

using MISSING not in a query: is it possible?

Hi everybody! I would like to know how to use MISSING operator in formatting. I hope my english is intelligible, it sounds very bad.
E. g. I would like to use it in a $if context, like this:
$if(%discnumber% MISSING,,Disc %discnumber%)
I know there are other ways, this was just an example, but in more complex titelformatting I'd find it useful! Is there any way to do this?
Thanks in advance

using MISSING not in a query: is it possible?

Reply #1
Code: [Select]
$if($not(%discnumber%),,'Disc '%discnumber%)

although I'd suggest you use
Code: [Select]
$if(%discnumber%,'Disc '%discnumber%)

or
Code: [Select]
['Disc '%discnumber%]

using MISSING not in a query: is it possible?

Reply #2
Thanks!
I tried this

$if($or($not(%totaldiscs%),$not($greater(%totaldiscs%,1))),Disc %discnumber%,)

but it doesn't work. Do you know why?

using MISSING not in a query: is it possible?

Reply #3
Code: [Select]
$if($or($not(%totaldiscs%),$not($greater(%totaldiscs%,1))),,Disc %discnumber%)
Why you are using the $not($greater( part but anyhow i think u put the Disc%dis...% part in the wrong place.

FYI you could also use the much convenient way i.e. [Disc: %discnumber%]

using MISSING not in a query: is it possible?

Reply #4
but it doesn't work. Do you know why?

Guessing at this, I'd say it's the use of $not() twice. List the conditions within one instance. Try:
Code: [Select]
$if($not($greater(%totaldiscs%,1),%totaldiscs%),'Disc '%discnumber%)

^I didn't test it.^

It appears you want to display the discnumber for only those files which lack a totaldiscs tag or whose totaldiscs tag is equal to 1. Is that correct? It's odd to me that you want to display the discnumber tag dependent upon the value of the totaldiscs tag. What's the reason for this? Please explain exactly what you're trying to do. An explanation makes it far easier to help you.

EDIT:

Scratch the above code. It won't work because I forgot about the $or(). Try this for now:
Code: [Select]
$ifequal(%totaldiscs%,1,'Disc '%discnumber%,$if($not(%totaldiscs%),'Disc '%discnumber%))

using MISSING not in a query: is it possible?

Reply #5
It appears you want to display the discnumber for only those files which lack a totaldiscs tag or whose totaldiscs tag is equal to 1. Is that correct?
Seems s/he wants, rather, to (1) only display %discnumber% if present and (2) only display %totaldiscs% if present and >1.

In which case, I’m getting rusty at title formatting, so excuse potential errors… but try something like this:
Code: [Select]
[%discnumber%$ifgreater(%totaldiscs%,1, of %totaldiscs%,)]
The square brackets ensure that nothing is displayed if %discnumber% is absent. If it’s present, then it’s shown, and the $ifgreater statement ensures that %totaldiscs% is only shown it it’s greater than 1.

using MISSING not in a query: is it possible?

Reply #6
Seems s/he wants, rather, to (1) only display %discnumber% if present and (2) only display %totaldiscs% if present and >1.


Yes that's exactly what I want to do!

Quote
In which case, I’m getting rusty at title formatting, so excuse potential errors… but try something like this:
Code: [Select]
[%discnumber%$ifgreater(%totaldiscs%,1, of %totaldiscs%,)]
The square brackets ensure that nothing is displayed if %discnumber% is absent. If it’s present, then it’s shown, and the $ifgreater statement ensures that %totaldiscs% is only shown it it’s greater than 1.


Yesterday I used this
$if($or($not(%totaldiscs%),$greater(%totaldiscs%,1)),Disc %discnumber%,)
and it worked. I'll try yours, it's cleaner! I didn't know you could write like that

using MISSING not in a query: is it possible?

Reply #7
Let me know if it does work! And if not, don’t give up on me straight away; I’ll figure it out.

using MISSING not in a query: is it possible?

Reply #8
LMAO that you deduced this
Seems s/he wants, rather, to (1) only display %discnumber% if present and (2) only display %totaldiscs% if present and >1.

from this 
$if($or($not(%totaldiscs%),$not($greater(%totaldiscs%,1))),Disc %discnumber%,)

You get props.

EDIT:
Btw, your string can be "shortened" because there is no else.
Code: [Select]
[%discnumber%$if($greater(%totaldiscs%,1), of %totaldiscs%)]

 

using MISSING not in a query: is it possible?

Reply #9
LMAO that you deduced this […] from this    […] You get props.
Haha, it’s either because it’s a fairly common style or because I do something vaguely analogous (only add either tag if there are >1 discs)… or something.

Quote
Btw, your string can be "shortened" because there is no else.
Thanks, I did suspect that was possible, but I wasn’t completely sure and so I erred on the side of caution.