Is there a list of the info I can read from the files and tags from QML? I can do a dir(app) to get all properties and functions but no documentation.
What I am looking for now is the track duration, either formatted or in number of seconds.
I get the app.selectionInfo.detailInfo which has the track duration at the end. I can extract that from the string, but what if that format ever changes? I assume that string has been compiled from different properties, that I hope I can getmyself.
So with importFromTags it's possible to get %{seconds}. Isn't there a getTag to get the seconds or duration without setting it in a frame and then reset the frame?
Cheers,
Jerry
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am a programmer but have not looked into the details of how tags are stored. To me it seems like quite a workaround, more of a detour if you ask me, to get information like the duration - either in text or seconds.
So seconds are available in tags but not in frames? Tag %{seconds} is available for importForTags but not when reading tags? I'd love to learn here.
Thanks
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I just found out that after getting the number of seconds via the comment file, the comments are not set back and the files in the GUI are changed. Can I reset these so I don't get the question whether I want to save the changed files?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
You are right, the current situation is a bit annoying. You could revert the files using the revert function.
The good news is that this will be improved soon. I am planing to release Kid3 3.8.0 on Saturday, and there is a new function which I will augment to solve this problem. The new function is actually an old one - import from tags - but a flavour which operates on all selected files (also from different directories), not on all files of the current directory. I have now enhanced this function to have a "pseudo tag" __return which will not change any tag but accumulate and return the captured values. So in your case, you could select one or more files and then call the QML function
@ufleisch, thank you very much for that quick reply. The __return tag is interesting and very useful! The app.revertFileModifications() works, thanks for that, so the workaround is OK for now, until the new version comes out. ;)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
Is there a list of the info I can read from the files and tags from QML? I can do a dir(app) to get all properties and functions but no documentation.
What I am looking for now is the track duration, either formatted or in number of seconds.
I get the app.selectionInfo.detailInfo which has the track duration at the end. I can extract that from the string, but what if that format ever changes? I assume that string has been compiled from different properties, that I hope I can getmyself.
I also got this info from a previous post:
So with importFromTags it's possible to get %{seconds}. Isn't there a getTag to get the seconds or duration without setting it in a frame and then reset the frame?
Cheers,
Jerry
I am a programmer but have not looked into the details of how tags are stored. To me it seems like quite a workaround, more of a detour if you ask me, to get information like the duration - either in text or seconds.
So seconds are available in tags but not in frames? Tag %{seconds} is available for importForTags but not when reading tags? I'd love to learn here.
Thanks
I just found out that after getting the number of seconds via the comment file, the comments are not set back and the files in the GUI are changed. Can I reset these so I don't get the question whether I want to save the changed files?
You are right, the current situation is a bit annoying. You could revert the files using the revert function.
The good news is that this will be improved soon. I am planing to release Kid3 3.8.0 on Saturday, and there is a new function which I will augment to solve this problem. The new function is actually an old one - import from tags - but a flavour which operates on all selected files (also from different directories), not on all files of the current directory. I have now enhanced this function to have a "pseudo tag"
__return
which will not change any tag but accumulate and return the captured values. So in your case, you could select one or more files and then call the QML functionThis would then return a list of strings containing the values (the seconds in this case). The same would be possible from the CLI
This will just output one line for each file. Or the second new function, JSON support in the CLI
This would return something like
{"result":["368","366"]}
in the case of two selected files with these durations.@ufleisch, thank you very much for that quick reply. The
__return
tag is interesting and very useful! Theapp.revertFileModifications()
works, thanks for that, so the workaround is OK for now, until the new version comes out. ;)