• Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 2.1
    • 1.3
    • Scripting
    • None

      $matchedtracks is broken in various ways:

      1. It now always returns zero. It tries to use the passed metadata to locate the attached file and from that the album and from that the number of matched files. However, I cannot see where the file object is set in metadata.

      2. This is really an album-level value - rather than a track or file level value and it should be the same for all tracks or files in an album regardless of whether the file is matched to a track or a track has a file associated with it.

      3. It currently requires an argument so you can use $matchedtracks( ) with a space between the brackets, but get an error if you use $matchedtracks(). This is illogical, Captain. We should change this so the function can take 0 or 1 arguments (to avoid backward compatibility issues - or 0 or more arguments).

      Anyway, I took a quick look to see if I could fix this quickly, but I can't work out how to fix it.

          [PICARD-637] $matchedtracks is broken

          Attempt to revive this and finally get the fix merged: https://github.com/metabrainz/picard/pull/1023

          Philipp Wolfer added a comment - Attempt to revive this and finally get the fix merged: https://github.com/metabrainz/picard/pull/1023

          Sophist added a comment -

          Sophist added a comment - Waiting for https://github.com/metabrainz/picard/pull/367 to be reopened.

          Sophist added a comment -

          The original PR was recommended for merge but also marked as `Further work needed` despite this (though I am unclear what further work is necessary) but due to other commitments I didn't pursue it and it was closed.

          I have now rebased this PR and requested that it is reopened in order that it is merged.

          Sophist added a comment - The original PR was recommended for merge but also marked as `Further work needed` despite this (though I am unclear what further work is necessary) but due to other commitments I didn't pursue it and it was closed. I have now rebased this PR and requested that it is reopened in order that it is merged.

          Sophist added a comment -

          Ah - ok.

          Sophist added a comment - Ah - ok.

          Wieland Hoffmann added a comment - - edited

          Like PICARD-643, I assigned this to you because you're the author of the pull request, nothing more, nothing less.

          Wieland Hoffmann added a comment - - edited Like PICARD-643 , I assigned this to you because you're the author of the pull request, nothing more, nothing less.

          Sophist added a comment -

          Perhaps so. What does it mean to have this assigned to me?

          Sophist added a comment - Perhaps so. What does it mean to have this assigned to me?

          Ulrich Klauer added a comment -

          You may have a misunderstanding about what being assigned to a ticket means here. Perhaps you are thinking of some other workflows where the assignment is passed around to whoever is expected to act next?

          Ulrich Klauer added a comment - You may have a misunderstanding about what being assigned to a ticket means here. Perhaps you are thinking of some other workflows where the assignment is passed around to whoever is expected to act next?

          Sophist added a comment -

          Why is this assigned back to me?

          I don't think I have anything to add. My PR has been awaiting merge or comment for over a year.

          Sophist added a comment - Why is this assigned back to me? I don't think I have anything to add. My PR has been awaiting merge or comment for over a year.

          A solution for such a scripting function to be also valid in the tagging script would be to re-run the script whenever a file is matched to a track. I think we had this discussion once, but I don't remember why Picard doesn't do this. Is it too much a performance impact?

          Philipp Wolfer added a comment - A solution for such a scripting function to be also valid in the tagging script would be to re-run the script whenever a file is matched to a track. I think we had this discussion once, but I don't remember why Picard doesn't do this. Is it too much a performance impact?

          Sophist added a comment -

          As a closing comment...

          I am not sure that the functionality of this really hits the spot for me because I can only use it to check whether all tracks have at least one matching file (by comparing it to %_totalalbumtracks%) and I can't use it to find out if the album has duplicated or unmatched music files.

          So we might want to create functions $isperfectalbum which uses the same logic as the RemovePerfectAlbums and enables you to use something like e.g. $if($isperfectalbum(),Complete/,FixMe/) at the beginning of your file naming script.

          Sophist added a comment - As a closing comment... I am not sure that the functionality of this really hits the spot for me because I can only use it to check whether all tracks have at least one matching file (by comparing it to %_totalalbumtracks%) and I can't use it to find out if the album has duplicated or unmatched music files. So we might want to create functions $isperfectalbum which uses the same logic as the RemovePerfectAlbums and enables you to use something like e.g. $if($isperfectalbum(),Complete/,FixMe/) at the beginning of your file naming script.

            sophist Sophist
            sophist Sophist
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                Version Package
                2.1