Hydrogenaudio Forums

Hosted Forums => foobar2000 => 3rd Party Plugins - (fb2k) => Topic started by: Case on 2018-06-17 11:59:00

Title: External Tags
Post by: Case on 2018-06-17 11:59:00
External Tags (http://www.foobar2000.org/components/view/foo_external_tags) is a new experimental component that allows tagging file formats that don't natively support tagging.

The component requires foobar2000 v1.4 version as it utilizes the new decoder priority configuration.

The component was created to allow ReplayGaining (https://hydrogenaud.io/index.php/topic,116045.msg958300.html#msg958300) tracker modules but it may be useful for other purposes too.
Title: Re: External Tags
Post by: Eclipsed Moon on 2018-06-17 15:42:00
I'd like to try it out, but I don't see how to set the component's priority as instructed.
Title: Re: External Tags
Post by: fbuser on 2018-06-17 15:46:54
Preferences ->Playback -> Decoding.
Title: Re: External Tags
Post by: Case on 2018-06-17 17:59:38
When the component is installed the decoder priorities are correct. They may need adjusting when you install new decoder components or old ones are updated to include the new decoder priority control.
Title: Re: External Tags
Post by: DVS on 2018-06-19 18:01:11
Hi, is it possible to implement the addition of selective tags to an external file, and add the rest of the tags as usual? (For example, to save personal or confidential tags separately from the music file). Thanks.
Title: Re: External Tags
Post by: Case on 2018-06-19 18:50:43
In theory but it would be messy. If you wish to do that you can move the (writer) part to the top of the decoder list, write the info you don't want to go to the files, then move the writer back to bottom.
Title: Re: External Tags
Post by: EpicForever on 2018-06-20 07:07:44
Confidential tags... What the hell could it be?
Title: Re: External Tags
Post by: Sergey77 on 2018-06-20 19:39:42
@Case, is it possible use External Tags component for edit metadata field for stream items in playlist (for example stream radio station) ?
Thanks.
Title: Re: External Tags
Post by: Case on 2018-06-21 11:44:08
It should be but tag writing routines don't seem to get called for streams. I'll probably need to consult Peter to see how to circumvent that restriction.
Title: Re: External Tags
Post by: Akel on 2018-06-24 01:56:25
What's the diference between this and the M-Tags plugin?
Title: Re: External Tags
Post by: Case on 2018-06-24 08:23:23
It's my understanding m-TAGS component requires loading files you want to tag to a playlist, use a menu entry to create tag files, remove the files from playlist and load the newly created tag files in their place.

This component will use external tags transparently. Just edit tags and they will be written as APEv2 tags next to the files you tagged. Load any file and external tags will be read if they exist.
Title: Re: External Tags
Post by: Sergey77 on 2018-06-24 17:24:49
I believe External Tags component can to have more potential and advantages in TAG edit, if @Case will progress it of course.
I personally like ease of use.
Title: Re: External Tags
Post by: sveakul on 2018-06-26 03:58:15
It should be but tag writing routines don't seem to get called for streams. I'll probably need to consult Peter to see how to circumvent that restriction.
Case a strong +1 for this from me, as Sergey77 mentions it would be great to have an easier to use, transparent option to m-TAGs in order to tag radio stream playlists, which are desperately in need of a way to show a fixed station name on each URL entry, etc.  I hope you will follow up with Peter on a solution.
Title: Re: External Tags
Post by: Case on 2018-06-26 08:46:22
I did ask Peter about it and it's apparently not too easy to accomplish. But I have already added a workaround that just needs some finishing touches.
Title: Re: External Tags
Post by: anamorphic on 2018-06-26 08:48:38
It should be but tag writing routines don't seem to get called for streams. I'll probably need to consult Peter to see how to circumvent that restriction.
Case a strong +1 for this from me, as Sergey77 mentions it would be great to have an easier to use, transparent option to m-TAGs in order to tag radio stream playlists, which are desperately in need of a way to show a fixed station name on each URL entry, etc.  I hope you will follow up with Peter on a solution.
Just FYI, you can do that already with m-TAGs (https://hydrogenaud.io/index.php/topic,97164.msg958135.html#msg958135) (as @Sergey77 posted), although as you say not automated. m-TAGs is quite handy for streams because you can even add artwork for each radio station / m-TAGs file (go to somewhere like onlineradiobox.com to find stations and art/logo)

Although yes, it would be nice to have an easy alternative. +1 to that. ;)
Title: Re: External Tags
Post by: sveakul on 2018-06-28 06:01:36
I did ask Peter about it and it's apparently not too easy to accomplish. But I have already added a workaround that just needs some finishing touches.
Thanks Case, looking forward to seeing this new version when it is ready! :)
Title: Re: External Tags
Post by: Porcus on 2018-06-28 23:39:18
Preferences ->Playback -> Decoding.

Suggestion: Put this information in the "About" box. People will search under Tools or Advanced.
* Also, will "writer" work "properly" if priority is higher, if the user wants external tags to overrule internal?
* Furthermore: if priority changes (by new or updated codecs, or user error): will reinstalling the component just rectify this? (If so, is there a way to do this simple?)

Let me suggest a text like e.g. the following (provided of course, that it is factually correct):

Adds tagging support for non-taggable file formats.
The tags are written as external files to the same directory as the target audio files.

For the component to work properly the "External Tags (reader)" decoder must have higher priority than the format to be tagged.
The "External Tags (writer)" decoder should have lowest priority unless you want external tags to take priority over native tags of any format.
Priority rules rules are automatically set correctly when foo_external_tags is installed. If codecs are installed or updated later, you may want to review priority rules (Preferences -> Playback -> Decoding) or simply reinstall foo_external_tags.
Title: Re: External Tags
Post by: Case on 2018-06-29 20:48:39
Thanks for the suggestion, Porcus. I'll steal your text with some edits if I'll release a new version. Your assumptions about the writer are correct. But re-installing the component doesn't fix decoder priorities. The core seems to remember positions even for removed components and reinstall returns the old order.

I have some bad news about the stream handling. My component seems to be completely circumvented by the FFmpeg decoder wrapper, which is required to support at least HLS streams. I can't make custom tags show up for this scenario.

Album art extractor is hardcoded not to run for streams so I can't show album art.

The latter problem could be kind of circumvented by loading a custom wrapper file instead of the actual stream and by handling the streaming hidden behind the scenes. But this confuses other components. For example Waveform Minibar thought it's dealing with a local file and tried to extract waveform never succeeding... And trying to wrap FFmpeg decoder wrapper this way appears to always fail.

Sorry for letting you down.
Title: Re: External Tags
Post by: sveakul on 2018-06-30 04:23:11
"Letting you down"?? ???  hey Case you gotta be kidding, THANK YOU for the work on this and for what it does!!  I don't run any HLS streams so for me at least that part is a non-issue.  The album art per URL absence due to the hardcoding is a drag but I've still got 4 "stub" images to pick from in normal display prefs which suffice for my radio moods..  MOST of them, haha.  Thanks again for all the work you do on all of your invaluable plugins  :) !
Title: Re: External Tags
Post by: Case on 2018-06-30 12:54:56
New version released. Biggest changes are the added album art support for local files and text-based tag support for streams.

Note that the regular Properties dialog won't attempt to save anything with streams. It's probably a bug that it's even allowed to be opened. Stream tagging requires using Tagging -> Edit External Tags context menu command. Tags added that way won't show up immediately on the playlist but once the stream is opened and stopped the edited tags should be visible.

Context menu also has a hidden-by-default menu entry for removing external tag files from selected tracks. It's visible when opening the menu while holding shift or can be made permanently visible in the context menu settings.

And files that have external tags can now be found if needed as $info(tagtype) will return "External APEv2" for them.
Title: Re: External Tags
Post by: Anakunda on 2018-06-30 14:24:08
My question to this plugin:
Can I somehow force it to use external file even for tagable formats (e.g. FLAC) but only per choice?
Is the plugin deciding completely automatically when it would be used and when not?
Eventually I could accept using external tags always for given format.
Title: Re: External Tags
Post by: Case on 2018-06-30 14:48:21
What kind of choice are you after? If you drag FLAC below the external tag writer in the decoder priority list no FLACs will get altered and they will get external tags instead. I could enable the context menu command for external tag adding for all formats and not just streams, but I don't really see the point.
Title: Re: External Tags
Post by: Porcus on 2018-06-30 16:46:33
If you drag FLAC below the external tag writer in the decoder priority list no FLACs will get altered and they will get external tags instead. I could enable the context menu command for external tag adding for all formats and not just streams, but I don't really see the point.

Since there is m-TAGS, I take it that there is indeed a demand for external tag files even for tag-able formats. (It is not a bad thing for maintaining a backup - you can run a backup on the tag files first, and then check what audio files have actually changed, and ...)

However, those who want that consistently should rather drag the Writer up to top priority? (Or second, after the tag Reader?)

A suggestion then:
A function to commit tags to media files - if different. (Overwriting only if there is any change.)
(Ideally, I would want to search for those files too, but that is likely quite a fuss?)
Title: Re: External Tags
Post by: Sergey77 on 2018-06-30 18:15:00
New version released. Biggest changes are the added album art support for local files and text-based tag support for streams.
Unbelievable!
@Case, you make us happy  :)
Thank you and respect for You, Coder!
We will try.
"Letting you down"?? ???  hey Case you gotta be kidding, THANK YOU for the work on this and for what it does!!  I don't run any HLS streams so for me at least that part is a non-issue.  The album art per URL absence due to the hardcoding is a drag but I've still got 4 "stub" images to pick from in normal display prefs which suffice for my radio moods..  MOST of them, haha.  Thanks again for all the work you do on all of your invaluable plugins  :) !
@sveakul, looks like you supported to @Case on time! Thanks!
Title: Re: External Tags
Post by: Sergey77 on 2018-06-30 20:08:51
I want to add a logo (.png from onlineradiobox (http://onlineradiobox.com/) thanks to @anamorphic) for stream radio item at playlist.
Case, could you tell, how can i do that with External Tags ?

Thanks.
Title: Re: External Tags
Post by: Anakunda on 2018-06-30 22:08:45
I could enable the context menu command for external tag adding for all formats and not just streams, but I don't really see the point.

Yes this. I see a point. Add a menu command like Force dump existing tags to external file for any format.
Eventually moving flac under external tags writter could also work but I don't want to move the flac too low as there's ffmpeg decoder which would take precedence.  Thanks.
m-Tags is too complicated for that purpose (save/remove/open)
Title: Re: External Tags
Post by: sveakul on 2018-07-01 04:28:46
I want to add a logo (.png from onlineradiobox (http://onlineradiobox.com/) thanks to @anamorphic) for stream radio item at playlist.
Case, could you tell, how can i do that with External Tags ?

Hi Sergey77:  as Case said in Reply#19 the new version adds album art support only for "local files", I assume what you ask cannot be done, due to the problem he mentioned with the art extractor hardcoded not to work for streams.  Of course, I would be glad to be proved wrong!!
Title: Re: External Tags
Post by: zoomorph on 2018-07-01 05:51:58
This is interesting! Could this potentially replace m-TAGS as a simpler solution to the problem of "never edit internal tags unless (rarely) specifically requested"?
- If external tags aren't present and tags for a file are changed, new tags should be written to external tags and not to internal tags.
- If external tags are present, context menu option to write external tags to internal tags.
 
Or is m-TAGS better because it's explicit whether you're working with the files themselves or the external tags? Perhaps that is better, but m-TAGS has other disadvantages when working with external tags that this solution (I think) would not (file operations don't work well).
Title: Re: External Tags
Post by: Sergey77 on 2018-07-01 05:54:43
I want to add a logo (.png from onlineradiobox (http://onlineradiobox.com/) thanks to @anamorphic) for stream radio item at playlist.
Case, could you tell, how can i do that with External Tags ?
Hi Sergey77:  as Case said in Reply#19 the new version adds album art support only for "local files"...
Hi sveakul!
Exactly, but I see that picture code is added to the .tag file (in external-tags folder) when I click Tagging/Attach picture/Artist for stream item. Also creates .tag file in external-tags folder for HLS item, but changes aren't displayed during playback.
We will hope...

Title: Re: External Tags
Post by: Case on 2018-07-02 06:52:28
The cover art reading code is present and active for everything, but it doesn't get called with streams. I currently have no solution for this.

@zoomorph I know there are people using the component for exactly that purpose. If you alter the decoder priorities and place the writer component above other decoders it will steal tag writes for everything. You can actually disable the tag reader part and just use the writer on top. It can perform all the operations on its own.

I'll see about improving the usage with taggable formats.
Title: Re: External Tags
Post by: Porcus on 2018-07-03 15:55:37
The following is not expected behaviour?

Selecting a track and looking at "General", it gives me "Tag type": "External APEv2" although there are none.
Converting FLAC to FLAC writes .tags files.
Furthermore, the FLAC files appear untagged, until I delete the .tags.

Version 0.6, with the Writer at the bottom of priorities, yes. fb2k 1.4beta17.
Title: Re: External Tags
Post by: Anakunda on 2018-07-03 19:01:07
I'm experiencing also writings dozen  of .tags files when embedding artwork into FLAC tracks (External tags writer at last slot also)
Title: Re: External Tags
Post by: Case on 2018-07-04 07:16:32
Sorry about that, fixed version of the component is up.

Tag reader was accidentally active even for tracks without external tag files and that caused the tagtype field to be erroneously reported. Forcing re-read of tags for affected tracks will correct the display mistake.

Album art editor isn't tied to any decoder and thus their priority order was probably random. The new version will only be active for files that have .tags files present for them.

This was baked from my work-in-progress version and its context menu also allows force-writing external tag for every file even when tag writer decoder is at the bottom. Though I realized it may be confusing, tag type shows External APEv2 in properties but if you edit it, it will get written to format's native tags.
Title: Re: External Tags
Post by: Porcus on 2018-07-04 21:23:43
New bug. Converted FLAC to FLAC and got
An error occurred while transferring attached pictures (Unsupported file format) : "g:\¤¤¤\tmp\Ifwhen - Null Set - 01 Linked.flac"
Disappeared when I uninstalled the component.
Title: Re: External Tags
Post by: Anakunda on 2018-07-04 21:56:45
Nice, the Edit External Tags is step the right direction, but it still suffers some flaws in consistency and writting logic:

- after creating .tag files and consequently using converter, the external metadata take precedence, but on opening foobar2000's properties, the old content is there, ie. not reflecting fresh external metadata
- on files removal and re-reading the folder content, the .tag content is already shown in properties, but on making any change to metadata via standard properties dialogue, the updated metadata are written to physical files instead to .tag files (intuitively they should be written to .tag files if they exist). My idea is to write ANY change to metadata to .tag files if they exist
- when doing RG scan, the RG info is still written to original files regardless if related .tag file exist or not, and this will probably apply to any other scanning task (BPM scanner, Lyrics grabber etc.)
- when enforcing external tags on multitrack file (CUEsheet), and reopening the cuesheet, the tags show up as total mess
- I have suggestion to write all external tags within one folder to single .tag file with predefined name instead of bunch of single .tag files for each track
Title: Re: External Tags
Post by: Anakunda on 2018-07-04 23:21:18
New bug.
An error occurred while transferring attached pictures (Unsupported file format) : "g:\¤¤¤\tmp\Ifwhen - Null Set - 01 Linked.flac"

Yeah editing embedded artwork causes error now on all formats. Indeed a bug

"Picture editing failed: Unsupported file format"
Title: Re: External Tags
Post by: Case on 2018-07-05 06:10:41
Component reverted to v0.5 before all the mess.
Title: Re: External Tags
Post by: sveakul on 2018-07-06 02:09:40
Case is it still "safe" to keep using the latest July 4th release if all we are doing is text-tagging radio stream entries?  Or will that technique be changing somehow with your next version so that waiting is recommended?
Title: Re: External Tags
Post by: Case on 2018-07-06 17:06:51
It's safe. If I change some format I'll maintain backwards compatibility.
Title: Re: External Tags
Post by: sveakul on 2018-07-07 00:10:38
Thanks Case!  This valuable plugin is needed and I know you'll work out the bugs, thanks for keeping us radio stream aficionados in mind.
Title: Re: External Tags
Post by: Case on 2018-07-14 22:32:32
New version up. Hopefully all the bugs are gone now.
Title: Re: External Tags
Post by: Anakunda on 2018-07-15 05:32:52
Thanks!
I still have bugs with reading external tags

Album > context menu > Tags > Edit external tags > make changes > Apply
Album > context menu > Replay Gain > Scan as a single album
RG is now stored only in tag files (right)
But Album > context menu > Properties shows no tags and that even on removing/readding folder to playlist
After tags files are created, the tracks metadata can only be shown by Tagging > Edit external tags
If that's by design, can also context menu > Properties command be redirected to Edit external tags, so that built in Properties command will always show actual metadata, and the same for Masstager and other 3rd party plugins
Title: Re: External Tags
Post by: Case on 2018-07-15 07:55:13
Currently the metadata you add with the context command won't be refreshed to the player automatically. Hacks require hacky workarounds to solve, I had a callback to reload info after tags were saved but it did not work. I can try other methods but for now you need to manually reload info for changes to be visible. And with streams you need to actually play them for the info to kick in.

I'm pretty sure Properties dialog can't be redirected.
Title: Re: External Tags
Post by: sveakul on 2018-07-29 02:56:02
Case, just wanted to say how much I enjoy using this plugin for my radio streams playlist.  I'm able to provide actual station names that stick (and genres), when previously having to deal with entries like "/" or "opus".  This thing is a beast, and so EASY to use right from context menu.  I also appreciate the fact that the tags are logically stored in their own folder right in Foobar instead of hidden in some "temp files" or other directory, and deleting a tag is equally as simple right from the context menu.  There's just no way to mess things up!  And easier to use than M-Tags.

Just as a FYI to other users, I noticed that an external tag is created (if none had existed) as soon as "Edit External Tags" is selected from the Tagging context menu.  If you choose it by "accident", or just decide you don't want to create the tag after all, hitting the "Cancel" button when the properties dialog appears does not stop a tag from being created.  Perhaps a better label for "Edit External Tags" would be "Create/Edit External Tags."

Thanks again and here's hoping the FB core will someday allow you to add artwork for radio stream external tags (a nod to Sergey77!).
Title: Re: External Tags
Post by: swanmaiden on 2018-07-29 10:54:15
I was in desperate need of this. Thank you so much.
Now I can manage my sheet music library inside foobar.
Title: Re: External Tags
Post by: Nisto on 2018-07-30 22:38:36
I've had a (probably crazy) idea for a tag storing solution for some time. Currently, with both m-TAGS and External Tags, we are unable to rename files without losing the associated tags, because the audio data and tag data are stored in separate files. One solution that I think might remedy this is to use NTFS alternate data streams (ADS). Aside from people potentially being unaware of its existence, is there any reason this has not or can not be done with a foobar2000 component? According to this site (https://wiki.sep.de/wiki/index.php/Support_for_NTFS_alternate_data_streams_(ADS)_for_Windows) there isn't any known size limit.

Quote from: SEP
There is no official limit to the size of the content that can be stored in the streams or to the number of streams, therefore the files with ADS can get quite big.
Title: Re: External Tags
Post by: Case on 2018-07-31 10:19:27
I actually thought about using NTFS streams at first but decided against it. The streams are hidden from regular users and they are easy to lose. They don't survive copying or archiving and can't be used for example on linux based NAS devices. I think a simple more transparent method is better. External tag is immediately visible and rather easy to rename or copy or move together with the media file in file managers.
Title: Re: External Tags
Post by: Nisto on 2018-07-31 13:33:10
They don't survive copying or archiving and can't be used for example on linux based NAS devices.

Hmm, under what circumstances doesn't ADS survive copying? I use Windows 7 SP1 (Ultimate, if that matters), and all streams are copied via Explorer, both if I use Copy and Cut. Also, WinRAR will store alternate streams if specified. I wouldn't be surprised if 7-Zip has an option too. I don't use a NAS personally, and I'd tend to agree with you on the points of transparency and portability, but in my personal opinion, tagging is such a difficult problem to solve. And I think ADS would solve more than a couple of problems. For example:
- renaming, as mentioned
- clutter (every single audio file has a corresponding .tag file with External Tags)
- file info propagation (m-TAGS shows Location info on the .tags file rather than the actual audio file)

Would it be difficult to add a second interface to External Tags that would allow you to make use of alternate streams instead? I understand if it's not easy to maintain and everything, so please don't do any more than you're willing to.
Title: Re: External Tags
Post by: Porcus on 2018-07-31 15:17:05
I actually thought about using NTFS streams at first but decided against it. The streams are hidden from regular users and they are easy to lose. They don't survive copying or archiving and can't be used for example on linux based NAS devices. I think a simple more transparent method is better. External tag is immediately visible and rather easy to rename or copy or move together with the media file in file managers.

Considered using both? Those who could think of editing the tag file "by hand", would probably understand a help file.
Title: Re: External Tags
Post by: sveakul on 2018-07-31 19:55:14
I actually thought about using NTFS streams at first but decided against it. The streams are hidden from regular users and they are easy to lose. They don't survive copying or archiving and can't be used for example on linux based NAS devices. I think a simple more transparent method is better. External tag is immediately visible and rather easy to rename or copy or move together with the media file in file managers.

My vote will always be for "easy" and "visible" over "complex" and "hidden."  That is what makes External Tags such a relief to use.  Just my opinion.
Title: Re: External Tags
Post by: Case on 2018-07-31 23:32:42
Hmm, under what circumstances doesn't ADS survive copying?
It isn't retained here when copying or moving from one drive to another.

I just uploaded version 0.9 of the component where I added an optional feature to use NTFS Alternate Data Streams for storing the tags. The setting is found under Tagging section of advanced preferences.
Note that the component will not automatically remove .tag files and those will be used for tag writing if they exist. To switch from .tag to stream, the old files need to be removed.
Title: Re: External Tags
Post by: sveakul on 2018-08-01 00:21:59
Man you're fast  :o !  But THANKS for holding on to the "easy and visible" option as well.  I guess sometimes you really CAN "please everybody"   :)
Title: Re: External Tags
Post by: Nisto on 2018-08-01 13:18:35
That was fast indeed! I never would've expected it so soon considering ADS is not all that well documented. Seriously, you're my hero of the year. Maybe I can finally get some sleep at last.
Title: Re: External Tags
Post by: DVS on 2018-08-01 20:13:59
The Tag Reader is marked and located on top. All previous (internal) disappear when an external tag is inserted.
With the tag reader unchecked, the internal tags are displayed again.
Version 0.8-0.9
What could be the problem?
Title: Re: External Tags
Post by: Case on 2018-08-01 20:53:34
What do you mean exactly? The external tag overrides internal one and that is by design. If you add a blank external tag it will look like the file has no tag at all. But that should require you to remove all the fields yourself, by default when you create a tag it should have all the values from the internal tag.
Title: Re: External Tags
Post by: DVS on 2018-08-01 21:21:48
When the checkbox is activated, all other tags are lost, including newly added external ones.
(https://i102.fastpic.ru/big/2018/0802/6b/857b8cb73641a1e51c3db05f98df7d6b.gif)
Title: Re: External Tags
Post by: Case on 2018-08-01 21:36:07
Is that a file you added an external tag to? It sounds like it is and the external tag is empty. If you hold shift, right click the file and select Tagging -> Remove External Tags your file should return to normal. At least after you reload metadata.

But how did you get into this situation? Is there a bug causing this or did you do something unexpected?
Title: Re: External Tags
Post by: DVS on 2018-08-01 21:58:34
This happens when adding a non-empty external tag. I can't understand the reason.
(https://i101.fastpic.ru/big/2018/0802/ca/d1c206775f3bd7f8b17f7f56a0a5a1ca.gif)
Title: Re: External Tags
Post by: Case on 2018-08-01 22:03:05
You don't give much information. Another situation I can think of is that you are dealing with cue sheets or other tracks with multiple subsongs and you only tag a single subsong. The file gets a new tag but only the subsong you tagged will have any information in it.

If it's something else tell at least what file format you are dealing with.
Title: Re: External Tags
Post by: DVS on 2018-08-01 22:08:43
This is a normal FLAC track, without CUE. "foobar2000 FLAC Decoder" is below the External Tags (writer) level.
PS. I just checked on a clean foobar2000 installation, the problem repeats. Maybe I'm doing something wrong. I will understand further.
Title: Re: External Tags
Post by: Case on 2018-08-01 22:19:47
Perhaps show what you do because I can't make it fail.
Title: Re: External Tags
Post by: DVS on 2018-08-01 23:44:24
I noticed the *.tag file is present, and it is not empty however, for some reason the data is not readable. Foobar displays an empty window because of this. Also, the problem is only in versions 0.8-0.9. Version 0.6 and below, external tags displays.
Title: Re: External Tags
Post by: Case on 2018-08-02 00:11:21
Sounds weird. I'll attach a debug version here that will report all exceptions to the console. Hopefully that will reveal what's going on.

Edit: attachment removed.
Title: Re: External Tags
Post by: DVS on 2018-08-02 00:28:29
at the time of adding an external tag:
External Tags - get_file_stats error: Object not found
External Tags - get_info error: Object not found
External Tags - 0 fields loaded
Title: Re: External Tags
Post by: Case on 2018-08-02 01:29:31
Alright, you were tagging with the regular Properties dialog. I hadn't tested that scenario since adding the context menu command to force external tag to any format.

The issue should be fixed in External Tags v0.9.1 (https://foobar.hyv.fi/?view=foo_external_tags). If everything works properly for you I'll put it on the repository when I wake up.
Title: Re: External Tags
Post by: DVS on 2018-08-02 02:48:54
I did not even pay attention to the special dialogue, believing that this is a duplicate of the standard only.
Now, it works, thanks!
Title: Re: External Tags
Post by: Porcus on 2018-10-19 19:47:48
Case, I know this question is outside the original intended use ("don't natively support tagging") but:

THE way to commit external tags back to internal would be
[(0) create .tag files, not ADS]
(1) Select the files in question
(2) Open Properties, and with Properties open:
(3) Delete the .tag files, or at least move them out of the way
(4) Make some change to the Properties, so that Apply lights up
(5) Apply or OK it
?

Title: Re: External Tags
Post by: Case on 2018-10-19 21:34:06
That works. Should work with ADS too, unless there's a bug somewhere.
Title: Re: External Tags
Post by: Case on 2018-10-20 12:14:35
@Porcus - new version released with a Commit context menu command (hidden by default). It will read the tags and possible album art, write the tags to file, remove the external tags file on success, then attempts to write the album art to the target. Album art handling here may be unnecessary code as I believe my component can only take over that functionality when the format doesn't support it natively.
Title: Re: External Tags
Post by: Porcus on 2018-10-20 13:28:51
RED FLAG! @Case :  Commit ate my tags. It left CDTOC and MUSICBRAINZ_whatevers, and the rest were cone.

FLAC files, new fb2k beta 4.
Title: Re: External Tags
Post by: Porcus on 2018-10-20 16:01:51
The remaining fields were "spam meta fields" in my LargeFieldsConfig.txt, and at least the following seems to provoke the behaviour consistently; some need Shift-rightclick.

Start with no external tags
Tagging -> Edit External Tags
Tagging -> Rewrite File Tags
Tagging -> Commit External Tags to file

I have issues getting the Commit up if I do not do anything to it in the meantime.

cone.

"gone", of course.
Title: Re: External Tags
Post by: Case on 2018-10-20 16:16:53
Thanks for the quick warning. I had tested it with previously untagged files and didn't see issues initially. New version uploaded that shouldn't cause such problems anymore.

Note that the Commit and Remove commands aren't visible unless foobar2000 reads the actual external tags. Until I fix automatic info refresh for forced external tags the most reliable way to make them show up is to reload info.

I hope you don't find more issues as I don't want to run out of version numbers. There are still some features missing before I can call it 1.0.
Title: Re: External Tags
Post by: Sergey77 on 2018-10-20 16:39:26
@Case, please take a look why HLS links stop works with External Tags?
error message appears: "Unable to open item for playback ()".
HLS link for testing:
Spoiler (click to show/hide)

Thanks!
Title: Re: External Tags
Post by: Case on 2018-10-20 17:57:44
Thanks for informing. Fixed. I also made tag edits refresh instantly (doesn't work with streams).
Title: Re: External Tags
Post by: Porcus on 2018-10-20 19:06:31
0.9.5 tested. "My" issue appears to be resolved.
Title: Re: External Tags
Post by: Sergey77 on 2018-10-20 19:20:00
Thanks for informing. Fixed. I also made tag edits refresh instantly (doesn't work with streams).
Yes, now that works fine!
@Case, Is it time to attach a picture for a stream link? :)
Title: Re: External Tags
Post by: Sergey77 on 2018-10-20 20:25:29
@Case, External Tags don't work for links of foo_youtube (https://fy.3dyd.com/download/) component.
for testing:
Spoiler (click to show/hide)
Please check it.
Title: Re: External Tags
Post by: sveakul on 2018-10-21 04:17:46
@Case, Is it time to attach a picture for a stream link? :)
What would be cool is to add a property like "link to specified image" in External Tags  where user could enter just the path to a specified image file for a radio stream which would then be displayed in the Album Art Viewer box as if it were an embedded cover image.  Case, is that a possibility?

Title: Re: External Tags
Post by: Case on 2018-10-21 10:25:22
New version posted. The component now listens for file deletion and moving callbacks and automatically moves and deletes external tags as needed.

And I added a wrapper method that allows forcing streams to go through the component so you can add album art. You can manually add url wrapped inside "exttag://(url here)" string or turn existing playlist entries to the wrapped format from the right click context menu.

Next plan for the component is to add an optional sqlite database for holding the tags.
Title: Re: External Tags
Post by: Sergey77 on 2018-10-21 13:21:42
@Case,
first of all I'm very happy that you managed to do the clever way ...exttag: // () wrapper...
I got identical view of the stream items at the playlist for External Tags and m-TAGS.
But during playback, the behavior of these items is different at playlist. For items of External Tags the contents $meta(genre), $info(tagtype), $meta(url) are missing (see pic. ETG).
For items of m-TAGS all the contents is visible during playback (see pic. MTG), that looks better. Also has the different look for %title%.
Is it possible to get for the elements of External Tags of the same view at playlist as for the elements of m-TAGS during playback?
One more question: m-TAGS can not attach the picture for the same link when the External Tags has already attached the picture?
(I get an error: "Attached picture editing failure on "D:\RadioPlaylist\Intense Radio.tags": Access denied"

p/s
Thanks for your persistence, diligence and work!
Title: Re: External Tags
Post by: Sergey77 on 2018-10-21 14:02:38
@Case, External Tags don't work for links of foo_youtube (https://fy.3dyd.com/download/) component.
for testing:
Spoiler (click to show/hide)
Please check it.
That fixed. Thanks again!
Title: Re: External Tags
Post by: Case on 2018-10-21 15:50:29
But during playback, the behavior of these items is different at playlist. For items of External Tags the contents $meta(genre), $info(tagtype), $meta(url) are missing

External Tags returns what the decoder returns. That's the same output you'd get from unwrapped stream. But I changed that for the next version.

One more question: m-TAGS can not attach the picture for the same link when the External Tags has already attached the picture?
(I get an error: "Attached picture editing failure on "D:\RadioPlaylist\Intense Radio.tags": Access denied"
You're sure you aren't attempting to use m-TAGS to work on a link wrapped behind the exttag:// protocol? My component shouldn't affect .tags files in any way.
Title: Re: External Tags
Post by: Sergey77 on 2018-10-21 16:49:49
I checked again, you were right. That m-TAGS does not allow to attach a picture to the link with the end .flac, but your component allows.
Everything works great!
@Case, please also consider the possibility to use the feature "Linked meta (field for inline editing)" in CUI for editing TAG fields directly from the playlist for External Tags.

Thanks!
Title: Re: External Tags
Post by: sveakul on 2018-10-21 17:55:35
Sergey77:  have you tried using the new wrapper to attach an image to a stream that isn't on a web url path, but on an internal path to an image file on your computer?  Is that working for you?  If so, what are you entering?  Thanks for any help!
Title: Re: External Tags
Post by: Sergey77 on 2018-10-21 18:27:01
sveakul: I attach local images to links that are on my computer.
When using External Tags, the steps is follows:
1. add a stream link to the playlist
2. right click on the link/Tagging/Wrap for External Tags (set in Context Menu)
3. right click on the link/Tagging/Edit External Tags
4. right click on the link/Tagging/Attach pictures/Front cover (when the warning window appears - click ok)
and choose a picture for the link. The picture will be displayed at field Artwork view.
Title: Re: External Tags
Post by: sveakul on 2018-10-21 20:09:37
Thanks Sergey77, this works!  I noticed that the new tag created in the "external-tags" folder after doing so grows in size to about the same as the picture attached, so I assume the picture itself is actually put inside the new "wrapped" tag, like embedding into an audio file.  I was hoping that instead it would just contain the LINK to the picture's location and Foobar could use that path to display it in the view box, but hey I'm good with this too  ;D

Case:  Possible bug noticed:  After a new wrapped tag has been created from an existing stream that had a "regular" external tag, using the context command "Remove External Tags" deletes the tag from the external-tags folder, but the stream's "properties" still show "Tag Type" as "External Apev2", and the filepath/folder name still have the prefix "exttag://" after refreshing the entry.  Can these be removed also from wherever  that info is being stored?
Title: Re: External Tags
Post by: Case on 2018-10-22 16:33:02
Good idea to remove the wrapping when external tag gets deleted. I'll add that.

About your album art link question, there are already multiple ways to achieve that. You could for example add a tag COVER where you write the name of the image you want to use. Then configure foobar2000 to look for images from that tag field under Preferences -> Display -> Album art. For example if you store cover images in C:\Covers you could add C:\Covers\%COVER% to the list.
Title: Re: External Tags
Post by: sveakul on 2018-10-22 19:39:23
Case:  first, thank you for planning on deleting the wrapper when the external tag is deleted, that will make it much easier to visually see what actually still has an External Tag from the properties window.

Second, WOW, your instructions on how to do a stream image display from a link instead of embedding in a wrapper works great!!  It even works fine without having to add a wrapper first.  Much appreciated!  For others who would like to see the steps I did:

1.  In Foobar's Prefs/Display/Album Art/Front cover, type the path to the folder you have images in (can be ANY folder path) into the Search patterns box followed by %COVER%, for example "E:\Media\%COVER%" (no quotes), and save.

2.  Select a stream from your playlist and, if it doesn't already have one, add an External Tag via right-click-->Edit External Tags;  you do NOT have to add a wrapper first.

3.  In the resulting Properties window, hit the "Tools" button on the lower left, and choose "add new field"

4.  Make a new field named COVER in "Field name", and in the "Field value" box, type in the file name of the image you want to display for that link that exists in the folder you specified in step #1 (E:\Media), like "blue ocean.jpg" (minus the quotes), and hit OK.

5.  Now refresh the link by double-clicking on another link, then double-clicking the modified link;  VOLIA, the picture you chose is displayed!  Sometimes it seems to need a second refresh to "take."

The above is tested for radio streams.  The think I like about this method vs. the wrapper embed is that it's fast and easy to change the image and you don't need to add that file size to the external tag itself.  Thanks again, Case, for your instructions!
Title: Re: External Tags
Post by: Case on 2018-10-22 19:53:03
I posted a quick update for the component a moment ago that includes the streaming changes. There's still apparently some potential weirdness possible with local subsong-enabled formats so other updates are on hold until I get those sorted.
Title: Re: External Tags
Post by: Sergey77 on 2018-10-23 15:23:19
Case: the component merge static metadata to dynamic metadata works great! Thank you!
sveakul, :)
I used your instruction and I also managed to attach a picture to the link. I liked this way too. Thanks!
Although the wrapping method is also good!
Now I'm "converting" my collection of Internet radio and HLS streams by use External Tags component. :)
Title: Re: External Tags
Post by: Anakunda on 2018-10-28 22:37:15
Can you please make a choice to store external tags in one file per folder, e.g. folder.tags. The bunch of small files makes me nervous and makes the folder messy.

Also how does work Store tags in Alternate Data Streams instead of .tag files? Not working for me.
Title: Re: External Tags
Post by: kode54 on 2018-10-29 00:31:31
Alternate data streams are not guaranteed to work on network shares unless you specially configure your Samba share server to support alternate data streams, otherwise there won't be any way to store them. On local file systems, they're only guaranteed to work on NTFS and ReFS, or maybe whatever you're running Wine on, assuming it supports that crap.
Title: Re: External Tags
Post by: Anakunda on 2018-10-29 06:58:54
That's NTFS drive directly connected, alternate data streams doesn't store anything.
Title: Re: External Tags
Post by: kode54 on 2018-10-29 07:08:40
Also note that Alternate data streams are not really visible in most file managers, but if it's not working at all, then it does sound like it's broken.
Title: Re: External Tags
Post by: Case on 2018-10-29 07:39:26
The component won't convert existing .tag files into streams. Remove existing .tag files and try creating external tags again. It will revert to .tag on unsupported file systems or other error situations.
Title: Re: External Tags
Post by: Anakunda on 2018-10-29 11:47:30
@Case
So, the Alternate data streams in principle do work on NTFS filesystem.
Please add the detection if ADS can't be used and use consolidated folder.tags instead.
The external tags are now recognized quite steadily by foobar, except the conversion. For target naming scheme external tags are always used (if present). But, for transfer of tags from source → output, external tags are not always used. It's random mixture of original and external tags. Maybe bad timing?

A minor extra wish: please add a menu entry "Create external tags" which will (re)create extern tags from original metadata content, without opening the properties dialogue.
Title: Re: External Tags
Post by: Case on 2018-10-31 17:09:35
Is there some reason you hope for additional command that won't open properties dialog? Note that opening the dialog won't slow the process down at all, copying existing tags and forcing foobar2000 to reload info is what eats all the time. If you don't wish to alter the tags you can just close the dialog immediately. But if you wish to do some changes you can do them immediately.

Here's an experimental version of External Tags component which uses only SQLite databases and doesn't otherwise touch the filesystem. I also simplified the subsong handling to hopefully solve all the weirdnesses @Porcus had to deal with.
Currently it uses different file name and names for commands so it can co-exist with the original External Tags component. This allows copying tags from the old external tag files into the new database.

This database approach should be quite a bit faster when dealing with large amount of handled files. But let me know if you hate it so I'll know to discontinue.

Edit: experimental component removed. Official version now has SQLite support.
Title: Re: External Tags
Post by: Porcus on 2018-10-31 21:34:45
* It is a very good point that you actually do not need to do any editing in the Properties window - the external tags are created already and I can just hit Esc.
But the DB version opens "Properties" (with "Partial info shown") early on while still "Processing files", and I don't know whether it is safe to hit Esc then?!?

* Speaking for myself, I want to use external tags - your component or foo_tags, whatever I settle on - to reduce "write risk" not only for everyday tag updates, but also for updating a backup. (Whether I am comfortable with overwriting a .tag or whether I want versioning.) So writing .tag files from a DB is a more wanted feature than importing .tag tags to DB.


* Initial testing, first uninstallin foo_external_tags uninstalled and then reinstalling both:

- I can no longer reproduce the issues I had!

- After removing external tags (no-db), I - often - need to "Reload info from file(s) if changed" for those FLACs that have embedded cue and subsongs - except, the first subsong gets fixed automatically.  (So it says that it has external apes for e.g. 78 % of the tracks in a single file.) But "if changed" was sufficient in all cases but one (in which it was an ordinary multi-file folder too) - unlike the next:

- After removing external tags (DB), I need to "Reload info from file(s)" from precisely those files which have subsongs. The differences are (I): "Reload info from file(s) if changed" is insufficient on these files, and (II): the first subsong also "has" External Tag until reloaded.

- Both components leave fb2k "Not responding" while running "Edit", until the properties dialogue is open (which, as said, happens "quite early" for the DB component). fb2k still plays music, but does not accept any other user input.
The DB component leaves fb2k "Not responding" on Remove as well, the non-DB does not.
Title: Re: External Tags
Post by: Case on 2018-11-01 06:51:11
But the DB version opens "Properties" (with "Partial info shown") early on while still "Processing files", and I don't know whether it is safe to hit Esc then?!?
The "processing files" dialog is from info reload. It is performed after last external tag is done and properties dialog is given the open call.

The reloading wouldn't be 100% necessary but without it if tags aren't edited no components will see the new tagtype info field. And tagtype info field is actually used currently for deciding whether to show the Commit and Remove commands in the context menu. Though with DB version this could be changed to use the DB directly. It was originally this way to not slow context menu opening down from needless filesystem accesses.

writing .tag files from a DB is a more wanted feature than importing .tag tags to DB.
So that's a vote against the SQLite direction. I was hoping to simplify the component but it sounds like that can't be done. Filling Anakunda's wish of combined per-dir tag files will further complicate things.

- Both components leave fb2k "Not responding" while running "Edit", until the properties dialogue is open (which, as said, happens "quite early" for the DB component). fb2k still plays music, but does not accept any other user input.
The DB component leaves fb2k "Not responding" on Remove as well, the non-DB does not.
These operations run in the main thread. The file-using version apparently benefits from disk caches. The OS removes files on the background when it can, database keeps operations in sync. The operations can be moved to a thread to not lock the UI though.
Title: Re: External Tags
Post by: arch21 on 2018-11-05 06:53:59
I don't know if it was mentioned before, but when I tried to convert a track to Wave 64, an external tag was created automatically. Is it possible to have it always try to create an external track when doing convert without tagging?
Title: Re: External Tags
Post by: Case on 2018-11-05 08:21:17
That should already work. The original intention of the component is to function as a fallback for formats that don't support tagging. Since foobar2000 can't tag W64 itself the component handled it. If you wanted to create external tags even for formats that do support tagging it could be achieved by moving "External Tags (writer)" higher up in the decoder list in Preferences.
Title: Re: External Tags
Post by: Case on 2018-11-09 18:09:30
I uploaded a new version to my site (https://foobar.hyv.fi/?view=foo_external_tags). The component has too many changes for me to be certain I didn't break something so it's not on the official component repository yet.

There are now settings under advanced preferences to control use of APE tags, SQLite database or @Anakunda 's request of combined folder.tags file. By default only APE tags are used so it should behave like the original version.

Majority of old APE-tag code has been re-engineered to hopefully be faster and less buggy. I hope @Porcus can verify that multitrack files work properly now.

There were other bug fixes too, like a fix for foo_fileops crash (https://hydrogenaud.io/index.php/topic,116817.0.html) the component caused when encountering Access denied-error.
Title: Re: External Tags
Post by: Sergey77 on 2018-11-10 07:56:36
@Case, thank you for new version!
It seems that v 0.9.9 doesn't display $info(tagtype) for HLS links.
Please check it. Thanks!
Title: Re: External Tags
Post by: Case on 2018-11-10 10:13:47
Have you perhaps only added art to the stream without using "Edit External Tags"? The tag loader only checks external metadata presence which could explain the missing tagtype.
Title: Re: External Tags
Post by: Sergey77 on 2018-11-10 12:18:52
I checked the behavior of the two versions, while my actions are the same.
I'm not trying to add art to the stream. I just add the HLS link to the playlist, then apply "Edit External Tags".
v 0.9.8 displays the tag type for HLS. Here is the link for testing:
Spoiler (click to show/hide)
Title: Re: External Tags
Post by: Case on 2018-11-10 13:49:09
I see the tagtype can be missing if the external tag is left blank. That issue is solved for the next version. If it's missing even when there's tag data I'll need to do more testing.
Title: Re: External Tags
Post by: Sergey77 on 2018-11-10 14:13:24
If it's missing even when there's tag data I'll need to do more testing.
I see the tag type when there's data in tag.
Title: Re: External Tags
Post by: Anakunda on 2018-11-11 10:16:37
This 0.9.9 version somehow doesn't work as expected. Regardless of which of Prefer folder/APE tags, write stream tags to SQLite, read all three tag types/Use only folder tags is selected, the Edit external tags doesn't create the external container nor any further metadata change is applied.
The last plugin from fb2k components repo did work almost as I wanted (except support for folder tags as backup option if file streams aren't avail).
Title: Re: External Tags
Post by: Case on 2018-11-11 11:33:01
The prefer options will use the preferred tag-writing method when creating new external tags for a file. If something else already exists it will be used. When using one of the "only" methods then only the chosen option will be used for both reading and writing.
Title: Re: External Tags
Post by: Case on 2018-11-11 11:47:20
Version 1.0 released. Fixed inability to save empty tags in APE and folder tags, fixed ReplayGain writing to folder tags, added album art support for folder tags and ability to change the folder.tags filename.
Title: Re: External Tags
Post by: Anakunda on 2018-11-11 13:16:03
Version 1.0 released. added album art support for folder tags
Trying version 1.0, I'd say almost perfect. All issues from 0.9.9 seem be gone, this new feature doesn't work -> folder.tags exist -> Tagging, Attach pictures -> albumart is physically written to audio files

Yet I ask for explanation how exactly does "Wrap to External tags" work.
Title: Re: External Tags
Post by: Case on 2018-11-11 13:43:45
The wrapping changes the file or stream links to force them to be handled by the component.

Without wrapping if you try to add cover art to a format that has working tagging the built-in art handlers see the supported file extension and External Tags will never be called. And if you try to add art to a stream the request is silently ignored.

Wrapping works around these problems by hiding the original file extension and protocol for the playlist entry. Link file://c:\path\to\music.ext is turned into exttag://(file://c:\path\to\music.ext).
Title: Re: External Tags
Post by: Porcus on 2018-11-11 23:39:25
The good:
I can no longer reproduce any multi-track file issue.  Tried both per-file tagfiles and per-folder tagfiles.

The not so good:
fb2k seems not to recognize all the external tags when I choose "folder". It leaves a few files in every few folders as a hit when I search by "%__tagtype% MISSING" or by "NOT %__tagtype% HAS External". Doing that search:
- some disappear if I ask fb2k to "Reload info from file(s) if changed".
- Of the remaining: some disappear if I repeat that.
- All the remaining disappear if I "Reload info from file(s)".
However, it did happen on at least one occasion that some reappeared after restarting fb2k and searching again; not instantly, but gradually while it was updating the library. (I have enabled both Rescan on startup and Monitoring.)

Running: beta 6.
Title: Re: External Tags
Post by: Case on 2018-11-12 13:32:47
Thanks for testing. Bug in loading optimization sometimes thought tag for a directory was loaded when it wasn't. Should be fixed in just released 1.0.1.
Title: Re: External Tags
Post by: Sergey77 on 2018-11-12 15:47:35
If you apply “Attach pictures” after “Edit External Tags” for the HLS stream, the tag type will be missing again (only if the external tag is left blank).
Title: Re: External Tags
Post by: Case on 2018-11-12 16:25:30
Fixed in 1.0.2.
Title: Re: External Tags
Post by: sveakul on 2018-11-12 20:24:23
Case, thank you for 1.03 just installed!  And thanks for maintaining the options for all users to continue using External Tags according to their own needs, however modest (as in my APE-only use).  Some developers end up losing the base functionality in an attempt to offer more advanced user options;  you maintain both :)
Title: Re: External Tags
Post by: Sergey77 on 2018-11-13 06:47:23
^ I join to the said.
Case,
please, take a look at the following: after applying the "Wrap for External Tags", the foo_yutube component stops opening the video (for HLS, YouTube links) only the sound is played. Thanks!
Title: Re: External Tags
Post by: Case on 2018-11-13 07:18:36
The YouTube component must have some checks to only activate video playback for normal playlist entries. It's better to keep those unwrapped.
Title: Re: External Tags
Post by: Sergey77 on 2018-11-13 07:41:18
The YouTube component must have some checks to only activate video playback for normal playlist entries. It's better to keep those unwrapped.
Ok, quite acceptable to me. I will use as sveakul written Reply #87 (https://hydrogenaud.io/index.php/topic,116141.msg963903.html#msg963903) for the foo_youtube component.
Title: Re: External Tags
Post by: Anakunda on 2018-11-13 21:21:50
A bug found on ET 1.0.3:
Applying external tags on CUEsheet + image randomizes the tracks order in playlist, otherwise in properties are sorted.
Title: Re: External Tags
Post by: Case on 2018-11-14 06:20:13
By "applying" do you mean creating external tags or the commit function that writes the external tags back to the tracks?
I can't imagine either doing anything like that unless you use auto-sorted playlists and the names change. Creating external tags doesn't touch playlist, committing will alter playlist in case externally tagged file was wrapped behind exttag:// protocol. The wrapping is removed and file is placed in the playlist at the same position the original file was at.
Title: Re: External Tags
Post by: Anakunda on 2018-11-14 06:29:08
Applying = Creating, and I don't use any auto-sorting.
The tracks order has changed and can't say if only visually or physically touching the playlist order.
Title: Re: External Tags
Post by: Case on 2018-11-14 07:03:15
Can you replicate the weirdness you see? foobar2000 doesn't alter track orders on normal playlists and the component doesn't have any playlist code for external tag creation. I suspect something else is going on.
Title: Re: External Tags
Post by: Case on 2018-11-14 10:06:52
Could it be you got confused about what order is mixed? To support the new folder-based tagging I call foobar's sort function to sort selection by path so that consecutive tracks will use the same folder.tags file for maximum speed. With image+cue that will alter the metadata order it shows in properties but it doesn't affect the actual order in playlist.
Title: Re: External Tags
Post by: Case on 2018-11-14 11:09:01
Released a new version with changed sorting so Properties dialog displays the tracks in subsong order. Also fixed bug preventing committing tags to files with multiple subsongs.
Title: Re: External Tags
Post by: sveakul on 2018-11-18 03:44:20
It seems that 1.07 has a regression:  the version info for 1.05 states "Editing external tags no longer needs to reload info from the tracks;"  however, with version 1.07 selecting a radio stream that already has an APEv2 external tag and choosing "Edit external tags" will cause a reload info operation every time before displaying the properties window.  On the same stream, just choosing "Properties" will not reload info on its own.  May have started with 1.06, but only noticed until now after going to 1.07.
Title: Re: External Tags
Post by: Case on 2018-11-18 10:13:58
The change log entry refers to a different behavior. The component used to call the "Tagging" -> "Reload info from file(s)" context command on the tracks after writing the external tags. That operation was annoying when tagging thousands of files as it could be rather slow with regular mechanical hard drives. That reload requirement was eliminated by informing the player about new tagtype with other means.

I actually tried to make stream tagging faster in newer versions by changing get_full_info_ref() function to just get_info_ref() for streams. The first one will reload info from files if it's not all cached and the latter shouldn't. But it seems accessing stream infos is still slow.
Title: Re: External Tags
Post by: sveakul on 2018-11-18 17:53:46
Thanks Case for the explanation.  As I understand it then, the changelog entry meant that the reload info call was just eliminated in cases of initially creating the external tag, not when going back to it later to change/add data and using the "Edit External Tags" menu selection.

This leads  me to a related question.  So when editing an already created APEv2 external tag for a stream, is there any difference/preference in doing so via the "Edit External Tags" choice which first does a reload info prior to bringing up Properties, or by just selecting "Properties" right off?  Is the first choice really only needed when the tag is being initially created?
Title: Re: External Tags
Post by: Case on 2018-11-18 20:09:48
For local files there's no difference once a file has external tag and decoder priorities are set correctly. For streams there is. Unless the stream link is wrapped opening normal properties dialog won't call any tag saving routines. All edits will just be ignored.
Title: Re: External Tags
Post by: sveakul on 2018-11-18 21:48:45
Thank you that is good information to know that I was unaware of.  Unwrapped stream (as all of mine currently are), use Edit External Tags; wrapped stream, just Properties.
Title: Re: External Tags
Post by: Anakunda on 2018-11-19 08:59:16
I'm testing ET 1.0.7 now and the previously reported bug is gone. However not fully stable yet, external tags from CUE playlist not all transfer to output files on conversion (all ext. tags are used for filename scheme during conversion). Just the metadata transfer fails case by case.
Title: Re: External Tags
Post by: Case on 2018-11-19 19:05:30
I had to rewrite the wrapping logic to fix that but frankly it was stupidly implemented earlier. CUE inputs should now work with Converter. The rewrite also allowed me to remove old HLS stream related hack I had in place.
Title: Re: External Tags
Post by: Sergey77 on 2018-11-20 13:38:23
Case, maybe the wrapping function should be available only after applying the "Edit External Tags" ?
Otherwise, if you applied the wrapping before, then how to unwrap it back !? Only through the use of "Edit External Tags", and then "Remove External Tags".
Title: Re: External Tags
Post by: Case on 2018-11-29 20:27:00
There were probably some reasons early on to have wrapping always available, but I see no need for that anymore either.
Title: Re: External Tags
Post by: Nisto on 2018-12-03 21:49:59
There appears to be a serious problem in the latest version of External Tags (v1.0.9). After tagging a set of files, the tags of the last file in the current playlist are repeated for anything subsequently added to it.

I'm using the default settings of External Tags on a clean portable installation of foobar2000 v1.4.1, with the decoders at the top of the priority list (writer first, reader second).  Reproduction steps:

1. Make sure you have the External Tags writer at the top of the decoder list, and the reader in second place
2. Make sure External Tags settings are default (Use only APE tags, "Store APE tags in Alternate Data Streams [...]" off)
3. Load a set of audio files into a blank playlist
4. Select the files in the playlist, right-click them and go into Properties
5. Assign a new tag to them
6. Add a new set of files to the playlist

The tracks you add in step 6 will all have the same tags as that of the last item loaded in step 3.


While I'm here, can I ask how "use only APE tags" works? I.e., what does it use to identify a file/track? Does it use common tags like artist/album/title? I looked in the .tag file in the foobar2000 configuration folder, but couldn't see any path references or other possible identifiers.

Also, can we have back individual file tags, instead of only folder tags?
Title: Re: External Tags
Post by: Porcus on 2018-12-03 22:55:34
@Nisto : Have you tried to select, Shift+right-click, Tagging, "Reload info from file(s)"? Still it seems I sometimes have to do that.

Also, can we have back individual file tags, instead of only folder tags?

Under fb2k's Preferences > Advanced > Tagging > External tags, select an "APE tags" option rather than "folder tags".
Title: Re: External Tags
Post by: Nisto on 2018-12-03 23:11:15
@Nisto : Have you tried to select, Shift+right-click, Tagging, "Reload info from file(s)"? Still it seems I sometimes have to do that.

Also, can we have back individual file tags, instead of only folder tags?

Under fb2k's Preferences > Advanced > Tagging > External tags, select an "APE tags" option rather than "folder tags".


Yeah, tried it. That doesn't help.

If I use an "APE tags" option (at least "Use only APE tags"), the component seems to only write a single .tag file in a folder called "external-tags" inside the foobar2000 configuration folder. What I want is for it to write a respective .tag file for each audio file, like you could in earlier versions of External Tags. That makes it easier to rename folders, copy files around, etc. without losing associated tags.
Title: Re: External Tags
Post by: Case on 2018-12-04 06:37:53
Sorry, seems I accidentally broke the original intented behavior. You can circumvent the problem by using the Tagging -> Edit external tags context command instead of Properties for now.
Title: Re: External Tags
Post by: Case on 2018-12-04 20:06:14
Fixed version uploaded.
Title: Re: External Tags
Post by: Nisto on 2018-12-04 21:42:38
It works! Thanks for the update.
Title: Re: External Tags
Post by: Nisto on 2018-12-06 14:25:39
Another small bug (for APE tags at least): with files that has subsongs, when you remove tags from a selected set of files, only the tags in the first selected item are removed. Same when adding/editing tags.

Also, hate to be nitpicking, but I notice External Tags writes an "external-tags.db" file in the fb2k configuration folder even when not using SQLite. Any way to avoid this?
Title: Re: External Tags
Post by: Case on 2018-12-06 16:50:29
Hopefully fixed.
Title: Re: External Tags
Post by: Nisto on 2018-12-06 17:29:26
Hmm. It seems to have fixed adding/editing tags, but removing still only removes the tags from the top item in a selection (both when I go to Tools -> Remove tags in the Properties window, and when I manually select all the tags and remove them via Delete key or context menu).

The tag data being written when removing all tags doesn't contain any subsong references. Maybe it has something to do with that?
Title: Re: External Tags
Post by: Case on 2018-12-06 18:29:09
I misunderstood what you meant by tag removal. I thought you were removing external tags. Wiping old tag contents means External Tags needs to write a tag with no contents. That works for me when I select everything in Properties and hit delete.
Title: Re: External Tags
Post by: Nisto on 2018-12-06 22:23:21
Case, what formats are you working with, that has subsongs? Here's what happens with GBS files for me:
Title: Re: External Tags
Post by: Case on 2018-12-07 20:32:08
I was testing with FLAC and my file had ReplayGain info, which doesn't get removed the way I wiped the tags. A version that allows writing blank subsong info into APE tags is now out.

Hitting the Remove tags button worked as you expect with gbs files which don't support native tagging, but when I hit it with an MP3 file foobar bypassed the External Tags and actually removed the tags from the MP3 file. So be careful.
Title: Re: External Tags
Post by: Sergey77 on 2018-12-08 05:09:03
Seem the component doesn't work properly for the following webradio links:
Code: [Select]
http://secure.live-streams.nl/flac.flac
http://radio-paralax.de:8000/;9623928300546054stream.nsv
http://relay-chi.gameowls.com/all.ogg?1:iXuQ4MxIpy
https://radio.kamchatkalive.ru:8103/chillout
Check, please. Thanks.
Title: Re: External Tags
Post by: sveakul on 2018-12-08 05:50:32
Hi Sergey77:  what exactly isn't working properly for you with those links?  I have an external tag on the Intense Radio FLAC link which works fine, but I made it several versions ago, not with 1.0.12--do the problems start with that version?  I just updated to it and don't want to start using it if it has an issue as I have many external tags for streams (all APEv2 only).  BTW I don't have an external tag on Radio Kamchatka Live Chillout but that's my favorite chillout stream, you have good taste :)
Title: Re: External Tags
Post by: Sergey77 on 2018-12-08 07:05:22
Hi! sveakul, thanks! :)
For all these 4 links, the "ExternalAPEv2" tag type is not saved after the start of playback. I think this behavior occurred earlier than version 1.0.12.
Does this link work fine for you? http://secure.live-streams.nl/flac.flac
For some reason my playback is interrupted for that link.
Title: Re: External Tags
Post by: Case on 2018-12-08 12:55:30
Those streams were broken with the decoder handling change I made to fix Converter metadata issue Anakunda noticed. The decoder is now chosen purely on file path and mime-type is ignored. I added mime-type support but something is still wrong, opening the FLAC stream takes way too long. I don't want to release an update until I know how to fix that.
Title: Re: External Tags
Post by: sveakul on 2018-12-08 18:03:16
Hi! sveakul, thanks! :)
For all these 4 links, the "ExternalAPEv2" tag type is not saved after the start of playback. I think this behavior occurred earlier than version 1.0.12.
Does this link work fine for you? http://secure.live-streams.nl/flac.flac
For some reason my playback is interrupted for that link.

Damn, I updated to 1.0.12 and now I have the same issues as you do!  Has to be because of the change Case mentioned in External Tags not looking at mime data for streams anymore.  Well now he's aware of it (thanks to you!) and we can wait for hopefully a quick fix.  Can't play several of my tagged streams now.  From what Case said it seems 1.0.7 was the last "safe" version for this but I don't think there is an "older versions" area it could be downloaded from in the meantime.
Title: Re: External Tags
Post by: Case on 2018-12-08 19:35:21
I released an update that adds the mime-type based decoder selection. It worked fast when I tested it but now it again seems to suffer from slowdowns with the linked FLAC stream.
Title: Re: External Tags
Post by: Nisto on 2018-12-08 19:35:57
Case: never got around to trying v1.0.12 (I'm a bit late, sorry), but v1.0.13 crashes as soon as I load a GBS file, so I can't confirm if the subsong tagging issue has been resolved.
Title: Re: External Tags
Post by: Case on 2018-12-08 19:46:03
Fixed.
Title: Re: External Tags
Post by: sveakul on 2018-12-08 20:24:35
Hi Case:  I updated to 1.0.14, but some streams still remain stuck in "Starting playback...", for example the stream Sergey77 reported (http://secure.live-streams.nl/flac.flac (http://secure.live-streams.nl/flac.flac)) , and also this one: http://rondo.iradio.fi:8000/klasu.flac (http://rondo.iradio.fi:8000/klasu.flac) .

Others seem only to intermittently have the problem, like http://89.223.45.5:8000/space-160 (http://89.223.45.5:8000/space-160) .

I was able to find a backup copy of Foobar I had made when using External Tags 1.0.7, and all streams work perfectly there doing an A/B between the ones with problems on 1.0.14.  A backup made using 1.0.10 also has the problems.
Title: Re: External Tags
Post by: Case on 2018-12-09 07:37:06
I could no longer replicate the slow opening of the FLAC stream or the links you provided with v1.0.14.

Could you test if the attached version works correctly for you. I changed the decoder search to try all decoders based on mime-type first before letting anything see the path.

Edit: Attachment removed as obsolete.
Title: Re: External Tags
Post by: Sergey77 on 2018-12-09 07:58:19
Noticed for v1.0.14.1:
1. When the External Tags (reader) is enabled, the behavior for these different (vorbis, FLAC) links is following:
Spoiler (click to show/hide)
2. With decoder (External Tags (reader)) is enable, clip search with internal function by foo_youtube "Search (Integrated)" -  is slow down.
3. It seems the component affects the operation of the foo_youtube. Symptoms are as follows: immediately after installing the External Tags - the foo_youtube component works well, but then the HLS video and YouTube clips stop working. I still do not understand what affects this behavior.
Title: Re: External Tags
Post by: Case on 2018-12-09 09:58:10
I updated the previous attachment. There should no longer be slowdowns for streams with no tags.
Title: Re: External Tags
Post by: Sergey77 on 2018-12-09 11:27:36
@Case, the component works perfectly for me now!
Thanks for the update!
Title: Re: External Tags
Post by: Case on 2018-12-09 13:02:58
Hopefully everything works well with Nisto's use case too. The test version from the attachment is now released properly.
Title: Re: External Tags
Post by: sveakul on 2018-12-09 17:48:51
Case:  just tried 1.0.15, all the streams I had a problem with now open normally, thanks a lot for the fix!
Title: Re: External Tags
Post by: Nisto on 2018-12-09 22:46:15
Case: Hey, sorry for the late feedback again. It works now.

EDIT: Sorry to be a PITA once again, but there is one more small problem I've noticed. When you go to the "Edit External Tags" context menu, it immediately creates external tags if they don't exist. But if you cancel out of the Properties window, the external tags remain. I think it would be better if the edit menu was disabled if there are no external tags, and have an explicit "create external tags" menu instead. And maybe in advanced settings, you could have an option for whether or not to copy tags from the source file when creating external tags.
Title: Re: External Tags
Post by: Porcus on 2018-12-09 22:48:29
Updated. Again, making the search
NOT %__tagtype% HAS xterna
makes a few lonely files (no more than one from each album) show up. But this time, all disappeared with "Reload info from file(s) if changed", no need for "Reload info from file(s)".
Title: Re: External Tags
Post by: sveakul on 2018-12-10 03:33:35
EDIT: Sorry to be a PITA once again, but there is one more small problem I've noticed. When you go to the "Edit External Tags" context menu, it immediately creates external tags if they don't exist. But if you cancel out of the Properties window, the external tags remain. I think it would be better if the edit menu was disabled if there are no external tags, and have an explicit "create external tags" menu instead

+1 for me on this also;  I mentioned the same in a previous post:  https://hydrogenaud.io/index.php/topic,116141.msg960392.html#msg960392 (https://hydrogenaud.io/index.php/topic,116141.msg960392.html#msg960392)

..and thanks for putting up with us PITA's!!

Title: Re: External Tags
Post by: Sergey77 on 2018-12-10 13:07:52
Hi!
Case: please, look the crash report in attachment. Thanks.
Title: Re: External Tags
Post by: Case on 2018-12-10 14:54:15
I think it would be better if the edit menu was disabled if there are no external tags, and have an explicit "create external tags" menu instead.
What benefit would the wording difference give? Or do you mean creation would not open properties so you'd have to open properties separately if you wanted to make changes?

Case: please, look the crash report in attachment. Thanks.
I can't do anything with this as it doesn't show any stack trace or call path where external tags is involved. But I saw some crashes in the crash logger for which I can download memory dumps.
Title: Re: External Tags
Post by: Sergey77 on 2018-12-10 15:06:33
But I saw some crashes in the crash logger for which I can download memory dumps.
Ok I can send that.
Title: Re: External Tags
Post by: Nisto on 2018-12-10 15:15:33
I think it would be better if the edit menu was disabled if there are no external tags, and have an explicit "create external tags" menu instead.
What benefit would the wording difference give? Or do you mean creation would not open properties so you'd have to open properties separately if you wanted to make changes?

The real issue here is that external tags aren't removed when you cancel out of the Properties window. If you unintentionally hit "create external tags" by accident, then you know you need to remove them first in order to get to the source tags, but currently, the behavior is kind of implicit, so you wouldn't know you were editing External Tags if you subsequently went into a regular Properties window. Sometimes you may actually want to modify the source tags even if External Tags exist, but there currently is no way to do so. As an alternative, maybe you could add an explicit "edit file tags" menu? That would be really sweet, actually. The idea is to primarily edit external tags if they exist, but the source tags should still be editable by some means.
Title: Re: External Tags
Post by: sveakul on 2018-12-10 19:47:52
I think it would be better if the edit menu was disabled if there are no external tags, and have an explicit "create external tags" menu instead.
What benefit would the wording difference give? Or do you mean creation would not open properties so you'd have to open properties separately if you wanted to make changes?

My take on this would be that if a file or stream currently has no external tag, the context menu should show "Create External Tag" as an option for those entries, and open the Properties window for editing the new external tag.  If an external tag does already exists, then the context menu choice for those files/streams would only show the "Edit External Tags" choice (and Remove of course) when changes need to be made, which would also open the Properties window.
Title: Re: External Tags
Post by: Case on 2018-12-10 20:09:19
People suffering from crashes with 1.0.15 should update to latest version. It will no longer attempt to access the decoder after it's gone. Curious that the crash logger only has entries for this issue with 1.0.15 even though the problem has always been there.

Here's a test version for Nisto that won't tag anything with Edit tags feature unless one edits tags. There is no automatic refresh for the changed info as foobar2000 doesn't see them automatically. Not sure it can be added.

And there's additional context menu command to force-bypass External Tags and edit file tags directly.

Edit: attachment removed.
Title: Re: External Tags
Post by: Nisto on 2018-12-10 21:14:40
@Case: Really unfortunate about the inability to automatically refresh the displayed tags. It worked in earlier versions - what has changed? Are you required to pre-create the external tags for it to work?

There seems to be some bugs. In my case, simply opening "edit file tags" and doing a "remove tags" on a FLAC file won't save the changes (I've looked at the actual file outside of foobar2000; it still has the same timestamp and binary data). Also, adding a new tag will remove all the tag data - yikes!
Title: Re: External Tags
Post by: Case on 2018-12-11 18:20:00
Second test version with above issues fixed and with automatic refresh after external tag edition.

Context menu was changed around a bit and now only "Edit External Tags" and "Edit file tags" are visible by default.

There's also explicit "Create External Tags" command that works like old edit command, but it's only available if selection has files that don't have external tags yet (or if over 100 tracks are selected in which case all context display rule checks are bypassed not to delay the menu opening).

Edit: attachment removed - new version with the changes has been released.
Title: Re: External Tags
Post by: Nisto on 2018-12-11 19:01:37
I'm okay with the new behavior. Thanks for all the hard work, Case!

Just one small thing so far: the "remove external tags" menu is missing.

Also, being that the "old method" now doesn't actually create external tags immediately upon entering the Properties window (it does so when actually Apply'ing or OK'ing), AND it automatically refreshes tags, I would be okay with you using whatever that programmatic approach is in all cases. I was expecting that, if I wrote external tags to >100 files, it would not automatically refresh the tags, or that it would immediately create external tags when the Properties window appeared - but evidently that isn't the case, which is great. Really, I don't even see a difference between the two methods.
EDIT: Okay, so you mention a "create" menu, but.. that doesn't show for me when selecting >100 files. Not even >1000 files. There's still only an "edit" menu.
EDIT 2: Sorry! Found it in the shift-context-menu.
Title: Re: External Tags
Post by: Case on 2018-12-11 19:35:10
The remove command is there, hidden by default like before. If you had manually made it visible in Preferences it might have changed as its index is different now. All the commands are visible when opening the context menu while pressing Shift-key.

The Edit command in the test version is different from the Create command as Edit does nothing unless you actually change something. Properties dialog won't retag files if there's nothing to do.
Title: Re: External Tags
Post by: sveakul on 2018-12-11 20:11:31
1.0.16.2 working great here;  appreciate the changes you made as to how the context menu is handled for streams with/without tags, thanks Case!  This thing is a real piece of work.
Title: Re: External Tags
Post by: Nisto on 2018-12-11 20:55:57
One last thing (I hope! God I'm annoying): would it be possible to show the "edit file tags" menu regardless of whether or not external tags exist? Mostly for the consistency.
Title: Re: External Tags
Post by: Porcus on 2018-12-12 11:46:17
Bug:
folder.tags not updated when fb2k renames files.

Version 1.0.16 from the repository. (This behaviour encountered in earlier versions as well.)
Title: Re: External Tags
Post by: Case on 2018-12-12 19:22:55
Porcus, I saw a problem when directory name changes as the path in the callback no longer had tag data. When only filename was renamed I saw no issues. Path change scenario is now handled in the new test version and I added automatic refresh for the metadata for rename cases too.

Nisto: that request makes sense. Implemented that too in the new test version.

Edit: attachment removed - new version with the changes has been released.
Title: Re: External Tags
Post by: Porcus on 2018-12-13 10:51:15
when directory name changes

Oops, I did not think over that: yes I might have used Move and changed directory name. What I did when I discovered it, was to open folder.tags in Notepad++ and find that the old filenames (but not the new) were still referenced. But of course, as Move moves other files, including folder tags ...

(Speaking of which: would it break major functionality to insert linebreaks and have one line per track in folder.tags?)
Title: Re: External Tags
Post by: Case on 2018-12-13 12:07:42
(Speaking of which: would it break major functionality to insert linebreaks and have one line per track in folder.tags?)
It's binary data and the tag reader parses the file based on lengths stored before each string. If extra characters are added the parser will see wrong lengths and will stop parsing as soon as the data doesn't match expectations. If field lengths are fixed to account for the extra newline character(s) they will be read into a tag value by old component.

I wouldn't want to break compatibility especially as I'd also have to support reading the current format.
Title: Re: External Tags
Post by: Sergey77 on 2018-12-13 13:32:25
removed
Title: Re: External Tags
Post by: Sergey77 on 2018-12-13 14:35:36
Hi!
Case: I noticed that the component v1.0.16 (It is not typical for v1.0.16.2(3)) does affect the video playback on HLS links (foo_youtube). When the decoder (reader) is on, some links stop playing (an error appears), or the video playback slows down.
For testing, I am attaching the HLS link: http://bcliveuniv-lh.akamaihd.net/i/iptv1_1@194050/master.m3u8
When the decoder is turned off, video playback is performed normally.
Title: Re: External Tags
Post by: Case on 2018-12-13 16:00:28
I don't see external tags being involved at all. Process Explorer's thread view shows pretty much only foo_input_ffmpeg and foo_youtube running. Also I don't have video working reliably even with foo_external_tags uninstalled.
Title: Re: External Tags
Post by: Sergey77 on 2018-12-13 16:25:04
Perhaps agree. The behavior of HLS links is unstable and possibly independent of the component. Still testing and still not established dependency.
Title: Re: External Tags
Post by: Nisto on 2018-12-13 23:14:33
Nisto: that request makes sense. Implemented that too in the new test version.

The "edit file tags" menu is only available if >100 files are selected (or if external tags already exists). Could you fix this?
Title: Re: External Tags
Post by: sveakul on 2018-12-14 00:23:54
The "edit file tags" menu is only available if >100 files are selected (or if external tags already exists). Could you fix this?

That's strange, I'm using 1.0.16.3 and right-clicking a single file or single stream on a playlist does show "Edit file tags" as a submenu of Tagging;  this for files with or without an external tag.  Of course it is selected as a context menu display option in Preferences as I assume yours is also?

(https://i.imgur.com/J3LSTaN.jpg)
Title: Re: External Tags
Post by: Case on 2018-12-14 06:32:50
There is a bug indeed but not the way Nisto says. I have left the option always visible but I should disable it for streams and archives as those have no native tagging.

Edit: Nisto, are you sure you downloaded the right attachment? I didn't remove the old one this time and it sounds like you installed .2 instead of .3.
Title: Re: External Tags
Post by: Nisto on 2018-12-14 07:50:07
You're right, I somehow thought I had been using the attachment in post #178 for the past couple of days, and could've sworn I even downloaded that attachment more than once. But apparently not, because now it works. What the hell is wrong with me..

Sorry for the false alarm.
Title: Re: External Tags
Post by: Case on 2018-12-15 10:54:14
Test versions taken down as I released a new version with the changes. The file move issue Porcus reported with folder tags also affected APE tags so that was fixed too. Only other change from the third test version is that "Edit file tags" menu isn't shown when only selecting streams or archives.
Title: Re: External Tags
Post by: Porcus on 2018-12-15 11:21:41
Question: how is the component supposed to work with "/" in ID3 tags? ID3 was invented by someone who didn't know enough about music to think about AC/DC ...

Feature request - although I am a bit hesitant to post such, given the work you have to put into it:
Is there a way from within foobar2000 to check if the media file is more recently updated than the tags file - or has different tags? Reasons:
* Tagging with other applications. Picard, MP3Tag, CUETools ...
* General robustness towards errors or mistakes or "potentially unwanted" behaviour. (Inter alia, the "/"?)

 (btw, I fully understand the backwards compatibility concern, but with all this testing I have had so many .tags files open in Notepad++ for human reading ...)
Title: Re: External Tags
Post by: Case on 2018-12-15 12:52:03
Question: how is the component supposed to work with "/" in ID3 tags? ID3 was invented by someone who didn't know enough about music to think about AC/DC ...
I don't think I understand the question. Since the component doesn't parse tags itself but uses metadata provided by foobar2000 the slash is read as foobar2000 sees it. If foobar2000 interprets artist as AC/DC that's what external tag will contain. If it gets read as two fields AC and DC, external tag will include two artist fields.

Is there a way from within foobar2000 to check if the media file is more recently updated than the tags file - or has different tags?
How would such info be presented? I imagine it would need a new dialog showing the track and differences between the two tag sets. It wouldn't be pretty with my skills.
Title: Re: External Tags
Post by: Porcus on 2018-12-15 14:36:03
I don't think I understand the question.

I am not sure if I understand the issue either, which was the reason for the vague "how is ... supposed to ..." question.
I'll do some more testing.


How would such info be presented? I imagine it would need a new dialog showing the track and differences between the two tag sets. It wouldn't be pretty with my skills.
From an end-user point of view, a query for files-newer-than-tags would do - but I have no idea whether that is implementable at all.


Title: Re: External Tags
Post by: Case on 2018-12-15 15:56:47
Test version with a new context command for finding tracks edited since external tagging. If it finds such tracks it will create a new playlist and place the findings there.

Edit: Attachment removed.
Title: Re: External Tags
Post by: Porcus on 2018-12-15 18:30:45
OK, I found the "issue" with the "/", and it seems "independent of" External Tags: If I force MP3 files into ID3v2.3, it seems that Tom / Dick / Harry becomes a multivalue field. So if fb2k
- has Tom / Dick / Harry
- creates External Tags out of that
- commits to files
it does sometimes happen that it comes out as multivalue and reads Tom; Dick; Harry.

But, I provoked the same to happen by "Rewrite file tags" without invoking External Tags. @Peter , is this expected behaviour?


Test version with a new context command for finding tracks edited since external tagging. If it finds such tracks it will create a new playlist and place the findings there.

All testing for this post done with that. Seems to work.
Title: Re: External Tags
Post by: Porcus on 2018-12-15 19:53:23
Seems to work.
Meaning: new functionality seems to work, no change detected in old behaviour. Including the "/".

Edit: Although ... now it seems easier to make fb2k unresponsive? More things stuffed into the "main" thread or whatever it is called?
Title: Re: External Tags
Post by: Case on 2018-12-15 20:25:36
The new function runs in main thread for simplicity. If it's what you want and you find it useful I can move it to its own thread.
Title: Re: External Tags
Post by: Case on 2018-12-16 11:12:49
Version 1.0.18 up with the new search function moved to its own thread. Also fixed a bug with reading back ReplayGain info from non-subsong enabled external APE tags.
Title: Re: External Tags
Post by: Nisto on 2018-12-16 22:59:36
Okay, here's a problem: if you select a set of audio files where only one of them contains a certain tag and you remove it (via "Edit External Tags"), it will only create a .tag file for the one file that contained the tag. I would've preferred it created a .tag file for all files, even if there's technically no change for some.
Title: Re: External Tags
Post by: Case on 2018-12-17 05:47:23
That's how properties dialog works. It doesn't call tagging functions unless something actually changes. I have been trying to tell about that since the 10th day. You wanted Edit command not to write anything until Properties dialog confirms the write and now it's implemented. But remember that I also added a "Create External Tags" command that will force-write external tags to tracks. The command is hidden by default so seeing it requires holding shift when opening the menu or ticking its checkbox in context menu preferences to make it always visible.
Title: Re: External Tags
Post by: Anakunda on 2018-12-17 09:14:50
A yesterday's update introduces a new bug: Context>Edit External Tags doesn't create folder.tags => Any further edit writes directly to audio files. Having the prefs to prefer folder tags, write stream tags to SQlite and read any format.

Damn, I forgot to read changelog, delete this post.
Title: Re: External Tags
Post by: Case on 2018-12-17 14:29:56
I didn't even consider that scenario, I was so accustomed to people using the Edit menu for all external tag editing. Hope you didn't ruin anything permanently.
Title: Re: External Tags
Post by: Peter on 2018-12-19 14:35:46
OK, I found the "issue" with the "/", and it seems "independent of" External Tags: If I force MP3 files into ID3v2.3, it seems that Tom / Dick / Harry becomes a multivalue field. So if fb2k
- has Tom / Dick / Harry
- creates External Tags out of that
- commits to files
it does sometimes happen that it comes out as multivalue and reads Tom; Dick; Harry.

But, I provoked the same to happen by "Rewrite file tags" without invoking External Tags. @Peter , is this expected behaviour?


Test version with a new context command for finding tracks edited since external tagging. If it finds such tracks it will create a new playlist and place the findings there.

All testing for this post done with that. Seems to work.

ID3v2.3 specification says that multi value fields are to be delimited with forward slashes. Real support for multi value fields was introduced with 2.4.
foobar2000 slightly bends the spec by delimiting the multi value fields with " / " (with the spaces), so actual artist names with slashes do not become multiple artists.
Title: Re: External Tags
Post by: Awesomeo on 2019-01-03 23:05:37
Heh, I've just tested the component without reading much into it (bravo me). I chose the sqlite option, because I love the idea of a neat .db file with all my extra info in there. And only then I noticed that external tags supersede the file tags. Looks like I was rather thinking about a use case I found posted here earlier:
Hi, is it possible to implement the addition of selective tags to an external file, and add the rest of the tags as usual? (For example, to save personal or confidential tags separately from the music file). Thanks.
Likewise, I thought about using external tags as something additional only for my personal purposes, like ReplayGain data, maybe my own set of ratings, tags, moods, comments or anything else that wasn't intended by the artist.

In the end it's not a big deal. Just a little bit redundant in my scenario because I will be left with a whole library of music files with [basic set of tags like artist, title, date] and quite a huge .db file with exactly the same [basic set of tags] + [some additional custom info].

Still, it's a great component, long sought after. Thanks!
Title: Re: External Tags
Post by: iridescentaudio on 2019-01-16 11:02:22
Hi, I hope this is the correct place to ask. If this issue has been addressed already I apologise but I couldn't find reference to it earlier in the thread.

I recently updated foo_external_tags to 1.0.19, though this may be coincidental as I also updated foobar2000 to 1.4.1. I have recently noticed that many of the external tags I have created in the past are no longer recognised in foobar2000 playlists - fields are appearing empty. It seems like it may only be certain formats that are affected, most notably modules (foo_dumb) and VGM (foo_input_vgm) in my experience. Example:

https://www.dropbox.com/s/own6853yh1dubye/externaltags.JPG?dl=0

When I select the "Edit External Tags" option for songs I know to have external tags like in the above screencap, it's clear that the tag info is safe, but I don't understand why it isn't propagating to playlists automatically. Manually selecting the Edit External Tags -> Reload Info option doesn't work either, and I expected it would, the only thing that does restore the external tags is to modify them to 'force' them to re-propagate. For practical reasons I would prefer not to have to carte-blanche modify (presently) 4,000 or so TAG files to add & then remove arbitrary junk data; is this my only option for getting them to re-propagate in playlists or is there a more elegant solution & explanation for why these tags aren't being picked up without intervention? I've also uploaded one example below if it could help diagnose the issue, though of course no guarantee it'll manifest the same problems on other computers as I'm not sure whether the source of the issue is this component or the main application.

https://www.dropbox.com/s/mtdwzxjge04hdov/Just%20For%20Fun.xm?dl=0
https://www.dropbox.com/s/25fgknzwgfiivgw/Just%20For%20Fun.xm.tag?dl=0

Thanks.
Title: Re: External Tags
Post by: Case on 2019-01-16 11:23:00
The problem could be caused by having wrong decoder priorities. Open preferences and verify on the playback -> decoding screen that "External Tags (reader)" is at the top.
Title: Re: External Tags
Post by: iridescentaudio on 2019-01-16 12:02:32
Aha, thank you Case! That was indeed the problem, though it isn't clear how the tag reader fell lower down the order of priorities - I'll keep an eye on this in future. Fortunately it was only foo_openmpt (actually) and foo_input_vgm that were higher priority so only those files need info reloaded.
Title: Re: External Tags
Post by: concept303 on 2019-01-28 04:54:50
Hi and thanks for this wonderful component and your hard work. It is much appreciated.
A few questions from me and please excuse my ignorance.
1. How can I enter a multivalued tag using external tags? Use the " / " separator? Something else?
2. I notice a bug when choosing File Operations > Copy to... on a file that has an external tag. The file copies, but the folder.tags file is not also copied to the new folder.

Once again thanks for your work and looking forward to use this component heavily (it is a life saver and better IMHO than m-tags).
Title: Re: External Tags
Post by: concept303 on 2019-01-28 10:22:18
1. How can I enter a multivalued tag using external tags? Use the " / " separator? Something else?
Okay, I have managed to find an answer for this here: https://hydrogenaud.io/index.php/topic,90371.0.html
Title: Re: External Tags
Post by: Case on 2019-01-28 10:46:54
Multivalue field separator is semicolon (;). The component uses standard properties dialog so same rules apply to external tags and regular tags.
Tag value copying isn't implemented. I assumed it isn't necessary. If you think it would be useful I can add the feature. But I can't think of use for track copying that doesn't involve taking the files away from current foobar2000 instance so it won't be added to SQLite database.
Title: Re: External Tags
Post by: concept303 on 2019-01-28 11:10:03
Tag value copying isn't implemented. I assumed it isn't necessary. If you think it would be useful I can add the feature.

Thanks Case. This feature would be useful, but not critical (at least to me). I am also not sure of the amount of work it requires. If it is easy, it could perhaps be added as a checkbox option in Advanced properties...something like "Copy external tag file(s) on file copy/move operations".

There is something else I discovered. I think it is a bug, unless I am misunderstanding something.
The issue is that when writing directly to the file's tags using the "Edit file tags" context menu command, the changes are not visible if I invoke again "Edit file tags" to do another edit.

To replicate:

If your restart foobar2000, then "Edit external tags" will show the value.

Alternatively, if we had set the tag via Right click > Properties, it would be immediately visible when using Edit file tags.

Hope I explained it clearly.

PS: In case it is important, I am doing these tests on FLAC files and under Preferences > Advanced > Tagging > External Tags I have selected the option "Use only folder tags...)

Title: Re: External Tags
Post by: Case on 2019-01-28 17:46:44
Adding tag writing for file copying isn't too much work. I can do that for the next version. But I seem unable to trigger the problem you described. Are the steps perhaps mixing up file tag editing and external tag editing? Editing file tags should produce no visible changes in foobar2000 for a file that has external tag present.
Title: Re: External Tags
Post by: concept303 on 2019-01-29 11:48:59
Hmm...I will try to describe this a bit differently.


I would expect the tag to show everywhere immediately after I enter it and reload the tags from file. I also would expect that it does not disappear when I press the Apply button. For the record, External Tags (reader) is first in the Decoding priority and External tags (Writer) is last (From what I am reading I suppose that's the way it should be. I installed external tags as my last component to make sure I get this order).
Title: Re: External Tags
Post by: Case on 2019-01-29 21:04:30
Fixed version released. Also implemented the external tag copying.
Title: Re: External Tags
Post by: Anakunda on 2019-01-30 09:49:54
A bug is here with latest update: when creating external tags for CUEsheet items, the original tags are copied+preserved only till first change. After that all items have the same name as 1st one (not changeable).
Title: Re: External Tags
Post by: Case on 2019-01-30 11:55:18
Thanks for reporting. I feared the way I fixed the refresh issue would have side effects and now I know what those were. Fixed the refresh issue in a better way to get subsong formats working again.
Title: Re: External Tags
Post by: concept303 on 2019-01-31 11:54:17
Fixed version released. Also implemented the external tag copying.

Thanks Case, will test.
Title: Re: External Tags
Post by: arch21 on 2019-02-03 06:02:27
I have an issue. I have a MP3 file with external tag. I want to replace the MP3 file with better quality (e.g 128 to 320 kbps) and keep using the tag file. All tag looks fine but general info still use info from old file, Any solution without recreate the external tag? thanks.

I'm sorry. I believe I did see this, but when I try to recreate the issue with other file, it doesn't happen.
Title: Re: External Tags
Post by: Case on 2019-02-03 07:54:26
If you do that and see old info, just reload tags from properties dialog or shift+clicked tagging menu.
Title: Re: External Tags
Post by: seriousstas on 2019-02-16 01:04:51
How add tags to the CUE sheet (*cue.tag) automatically when adding from the library?

How disable properties window call when "Create external tags"?
Title: Re: External Tags
Post by: Case on 2019-02-16 07:43:08
There is no automatic tag creation implemented and I see no reason to add such a thing.

There is no option to disable properties dialog opening. You can use the dialog to verify that all tracks got external tags and make any changes you wish. Or just close it instantly if there's no need for that. I could add a setting for this behavior if it is a huge bother.
SimplePortal 1.0.0 RC1 © 2008-2019