Check whether file exists

I do have a workaround if this isnt possible, but i would like to know:
How does mp3 tags execute action groups?
If i make an action group that imports a (text) file in a temporary tag, then writes "yes" into another tag if the temporary tag exists, then deletes the temporary tag,
does mp3tag
a) actually write the temporary tag in the file, and then deletes it
b) go through the entire action group and only writes the result (in this case only "yes" in the other tag, to minimise file rewrites.

Real question: is it possible to check if a file outside the audio file / tags exists? If above workaround results in a ridiculous amount of rewrites id rather not do it, but from the documentation it looks like you can only check for tags within / properties of the audio file being worked on.

No, this is not possible. *
Mp3tag loads a track, execute the actions you run manually and repeat this with the next selected track.
There is no way "to look around" and depending on what you will find decide to execute other actions or filter or whatever you do in Mp3tag.

* There is one exception:
If you import a cover, your action looks for such a cover and import it only if it exists.
But you can not say - for example - "if the external cover is too big, choose a smaller one".
It's only a "if exist -> import -> else do nothing" decision.

thought so...

then the question is if my workaround would work without excessive file rewrites
(it does for the desired result, as i tested it on a few test tracks, only the potential uneccessary file changes worry me now)

Without knowing what exactly do you want to achieve, it's nearly impossible to answer your question.
Maybe there are shorter or more direct ways for your goal?

You would have to share your idea with more details to get a more useful answer.

this is the action group. as you can see:
if the lrc file exists the tag "haslyrics" should contain "LRC",
if only unsynced lyrics in a txt exist, it should contain "TXT"
and if both exist (because synced lyrics got either downloaded or made by me after an unsynced file existed) it should say "BOTH"
if neither file exists, the tag should be blank/inexistant.

that works as a solution, but does it really write the entire contents of the lrc and/or txt into the tags (lots of unneccessary rewrites) just to create the "haslyrics" tag, or would mp3tag go through the actiongroup and then change the file (aka only writing the "haslyrics" tag or dont change it at all if the files dont exist)

My first thought was:
Why not just create two folders in your file system:
One with the lyrics in LRC format
and
One with the lyrics in TXT format

Then you only need to import the LRC into a custom tag like SYNCEDLYRICS
and import the TXT into the official tag UNSYNCEDLYRICS.

With a filter you can easily show the tracks with either content in one or the other tag or even in both tags.

i dont want the lyrics in the file at all!
just a note whether they exist or not.

Whatever you like :wink:

I would never use such dependencies. Wherever I play a song, I would like to see the lyrics (as far as the player support it).
Personally, I don't see any advantage in a hint like "you have lyrics for this track. Not embedded. But somewhere else, just search it if you want to see it..."

I agree. Whether this is for lyrics or even album art, depending on a separate file can lead to unexpected mismatch in the future. But especially with lyrics, the text content size is relatively small compared to an audio file so this shouldn't add a significant amount to the storage. The added stability is a positive trade off IMO.

i find unembedded easier to work with, both from an organisatorial and editing pov. (except the one thing in this thread).

but hey, that comes down to personal preferences. and propably the software/devices
you use (and in the case of album art: size)

1 Like

ok before this topic gets locked: i did a test:
test flac file:
nothing
embeding a cover 7mb
embeding and resizing
embeding resizing and deleting
in one action group each

only the flac file without resizing increased by 7mb. due to the flac padding issues i assume that this means mp3tag only applies the finished action group to the file and not every single action in sequence.
would like to have confirmation but otherwise this could be considered solved.

Absolutely agree, everyone has their own preferences combined with the demands of their environment.

It is rare that in the case of lyrics, there are players that support lyrics but not those that are embedded. These text components are relatively small in comparison to the audio. Either way as far as overall storage goes the content would be saved whether in a separate file or embedded, so no drive space is saved for lyrics. Again this does eliminate the chances of losing the dependence in cases where files and/or folders are being renamed.

With album art, for those that keep extremely high resolution files, these do add to the required storage space especially if the library is extensive. A suggestion in this case is to embed a lower resolution cover for use in portable applications, and a single full resolution file can be kept in the album folder. Use the settings in the local player to prefer the folder file over the embedded one, while the smaller embedded covers are transferable with the main media file.

Again just suggestions to handle the original request rather than looking to add a new action to look for external files that mp3tag currently does not have.

Is this reply intended for a different thread? Seems out of place here.

no this is for this thread, as the only outstanding issue is, if my workaround would lead to excessive uneccessary file rewrites or not. and if i interprete that test correctly it does not, thus i would have a working and useable solution.

(with the solved for the thread being LyricsLovers first response, i assume i am to tick that box once im satisfied with the thread)