Is ... $is_complete ... broken?

Somewhere through to the latest development release, $is_complete seems to have become non-functional.

$noop(★ How to designate Complete Albums that contain multiples of at least 1 Track 1 ★)
$noop(★ 0, They are Handled as InComplete ★)
$noop(★ 1  They are Handled as Complete w/starred but not Gold icon★)
$set(_extraTrackHandling,1)
$set(_earlierPresortForIncompletes,1)
$set(_incompleteDirectory,Partial)

$if($eq(%_earlierPresortForIncompletes%,1),$if($eq($is_complete(),0),$if($lt($matchedtracks(),%_totalalbumtracks%),# - %_incompleteDirectory%)),$if(%_isIncomplete%,# - %_incompleteDirectory%,))/

This works with a 2.2.x release, but not in the latest development release.

No, $is_complete() was broken and got fixed :wink: The correct way to check this is now:

$if($is_complete(),...)
1 Like

Removing the now un-needed $eq …

This:
$if($eq(%_earlierPresortForIncompletes%,1),$if($eq($is_complete(),0),$if($lt($matchedtracks(),%_totalalbumtracks%),# - %_incompleteDirectory%)),$if(%_isIncomplete%,# - %_incompleteDirectory%,))/
to This
$if($eq(%_earlierPresortForIncompletes%,1),$if($is_complete(),$if($lt($matchedtracks(),%_totalalbumtracks%),# - %_incompleteDirectory%)),$if(%_isIncomplete%,# - %_incompleteDirectory%,))/

Still isn’t working.

Did $eq change, or $is_complete?
As in how much other scripting is dead now? … and anyone who’s got stuff posted using $if($eq($is_complete(),0)

I don’t know what all this stuff is in your script and what it does and why it does not work. You need to test this step by step and see what is not working. All I can tell you is that $if($is_complete(),...) works.

No worries, we did not change equality check. This still compares for the same value.

$is_complete, $startswith and $endswith previously wrongly returned always a true value, unlike other similar functions such as $gt. Hence $if($gt(3,2),...) does what you’d expect, $if($is_complete(),...) not as it was always true. This is why you needed the workaround with $eq. But it’s a bug and it’s fixed now.

The following code needs to be replaced:

$eq($is_complete(),0)  ==> $is_complete()
$eq($startswith(x,y),0)  ==> $startswith(x,y)
$eq($endswith(x,y),0)  ==> $endswith(x,y)
2 Likes

That reply kind of felt like a dog pile rant attack… :wink:

Still not being able to wrap my head around “why” it didn’t work, I started backtracking and figured out that PICARD-1667 was where this came up. (Those darned old Classics… )

Still not figuring it out, I went back and reverted script back to what it had originally been just so I can see it work and not work on the same code base.

That is when I realized that script-wise, I was using the same syntax earlier in my script too.

So. Yeah, no wonder changing it later didn’t work. It was still “wrong” when it “got there”.

But then I’m looking at Detect Video … and, well, shouldn’t that be not working now, too?

Is_Video, Is_Lossy/Lossless and such actually didn’t have the 0 returned. Which was also a point of “WTF!?! but it works here” when I was figuring out scripting in the beginning.

Okay, so at least the results are all consistent now, and I will consolidate uses of opposing methods to determine stuff.

$noop(★ Detect Incomplete ★)
$if($eq($is_complete(),0),
  $set(_isIncomplete,1)
)
$noop(★ Detect Video ★)
$if($eq($is_video(),0),
  $set(_isVideo,1)
)

So somewhere between PICARD-1517 and 1667 I came in and really took to using $is_complete and instead of coming to the conclusion that something hinky is going on and raising the question, I gave in and then missed the actual discussions that I should have found… :upside_down_face:

Once again. Picard Wins.

1 Like