INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Code needed for showing if any items are not checked  (Read 858 times)

wheel54

  • Recent member
  • *
  • Posts: 28
Code needed for showing if any items are not checked
« on: June 09, 2023, 08:29:32 am »

So my current view has a grid icon like display sorted by the custom field "groupings" (which is just a way for me to sort music that belongs together imo) with the thumbnail text set to:

[Grouping]
<font size="80" alpha="50">formatnumber(GroupCount(Album), 0, no albums, albums, album)<//font>  |  If([Duplicate], ✔, ??)

I'm using the custom "duplicate" field to mark albums I've sorted.  I would like to put a ✔ on the main display for any grouping with all albums sorted in that group (all songs have a non-blank duplicate field), however what is happening is that it shows "??" correct on a group where no filtering is done and the field is empty, but as soon as I go through one of the albums and set the value to 1 or 2 or whatever, even though there are other albums that need to get done, the subtext is getting the ✔ displayed using the code above. 

Basically I only want it to show that if all the songs in that grouping are done / have an entry entered for the "duplicate" field.
Logged

wheel54

  • Recent member
  • *
  • Posts: 28
Re: Code needed for showing if any items are not checked
« Reply #1 on: June 09, 2023, 11:23:57 am »

Still really struggling with this.  Like every function I try to use seems to prioritize the positive results over the negative one.

I simply want the empty result to be prioritized, there must be some way to word it so it does that.  In a group with 4 albums, if it finds one album with fields and 3 albums have no fields it always reports back as fields found, instead of what I want, it to indicate when there are missing fields for the result.
Logged

blgentry

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 8014
Re: Code needed for showing if any items are not checked
« Reply #2 on: June 09, 2023, 12:03:57 pm »

I can't decipher what you are trying to do or what you see.  It might be helpful to post screen shots showing what you are doing and what you see.

Best of luck.

Brian.
Logged

wheel54

  • Recent member
  • *
  • Posts: 28
Re: Code needed for showing if any items are not checked
« Reply #3 on: June 09, 2023, 12:27:04 pm »

Hmm, I can do that later, but I'm not sure it would help that much.  Basically in category view you have the custom thumbnail text - you can enter the expressions here.

When you double click an item in category view it opens it up, showing the contents (albums in this case). 

So basically the hierarchy is this:

Grouping (subtext) -> Album(s) (subtext).

Say there's 5 Albums under the parent grouping.  If all 5 albums have an empty duplicate field, they return "??" as per the code, both individually and in the main parent grouping.

But as soon as 1 album has values for the duplicate field, in BOTH the album subtext and grouping (parent) subtext the ?? changes to a check mark.  I want it only to happen in the Album subtext until the entire grouping has values, only then would it change the ?? to a checkmark.  But currently that changes over the second any track has a value in the duplicate field, and only stays ?? while the values are all absent. 
Logged

blgentry

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 8014
Re: Code needed for showing if any items are not checked
« Reply #4 on: June 09, 2023, 07:04:36 pm »

You're going to need someone who's better with the Expression Language than I am. 

I see what you are saying:  The display is ORing the value of [Duplicate] for any Album or "Grouping".  You want it ANDed instead.  I don't think the grouped displays are designed to do that.  This might be a case where you need to use Global Variables in order to calculate a value per album, as a separate variable.  Global Variables are good for that kind of thing, but they are quite confusing; I haven't used them in a number of years.

Hopefully one of the other members that's really skilled with this will respond to your question.

Best of luck to you.
Brian.
Logged

blgentry

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 8014
Re: Code needed for showing if any items are not checked
« Reply #5 on: June 09, 2023, 07:08:01 pm »

A different thought on this:

It sort of seems like you are using this [Duplicate] field as a way of auditing your collection and guiding yourself to the parts that need you to work on them next.  If that's true, then you should be using a Panes view instead of a Categories view.  Panes views have very powerful filtering features.

For instance, you could easily show files with duplicates, files without duplicates, etc.  You can drill down through them by any criteria: file path, artist, genre, or whatever.  You can select multiple criteria.

I've used Panes views for all kinds of auditing tasks, like making sure all my albums have cover art stored and that the art is a certain size.  I've written a Duplicate Finder as a Panes View that takes into account several different selectable criteria.

Hopefully this gives you some more information to consider.

Brian.
Logged

wheel54

  • Recent member
  • *
  • Posts: 28
Re: Code needed for showing if any items are not checked
« Reply #6 on: June 10, 2023, 09:30:49 am »

I think if there was a way to get it to tally the number of songs within a grouping, so say the Group field is "Coldplay" and there's 75 tracks tagged with "Coldplay" for their Group field.  If there's a way for it to tally up and get that 75 number, then it would just need to get the tally for the Duplicate field (the value basically is always 1 when done, or 0 when not).  So if the Group tally > Duplicate tally then display "??" (not fully complete) otherwise checkmark (when the two fields are equal, and the count of Group is not greater than Duplicate).

But in the meantime I've taken to the panes view suggestion and that will work for now.  Still curious if the above would be possible or not, as I find it a little more enjoyable to work from the covers/catalogue view.
Logged
Pages: [1]   Go Up