Uploaded image for project: 'Picard'
  1. Picard
  2. PICARD-2767

Make a file's original metadata available in tagger script

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Normal Normal
    • None
    • 2.9.2
    • Scripting
    • None

      Issue

      In some circumstances it is useful to access a file's original metadata from within a tagger script. For example to compare newly loaded metadata to the existing one in the file, or to check whether existing data already had certain values.

      Currently while a file's tags will be available in scripting (since PICARD-259 ) the values get hidden by data loaded for the track.

      See also discussion at https://community.metabrainz.org/t/can-picard-read-existing-file-tags-and-use-those-for-scripting/657353/16

      Implementation

      Picard could offer a function (e.g. $file_get) to access the file's original data. That will require making the file itself available to the parser.

      Generally this option already exists in scripting, but it is only used in file naming scripts. In all other scripts the file is not passed to the context, even if it would be possible.

      This can be changed, but care has to be taken how this effects the matched tracks and is_complete functions. Theoretically making the file available in the context will make this functions work also in the tagger script case (and not only for filenaming as it currently is).

      But since scripts are executed once a track gets matched, independent of whether other files have already matched, this can cause the functions to return inconsistent results.

       

       

            Unassigned Unassigned
            outsidecontext Philipp Wolfer
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:

                Version Package