IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Import present values only
Kevin04
post Apr 29 2012, 13:05
Post #1


Member


Group: Full Members
Posts: 8
Joined: 13-January 11
Member No.: 13594
Mp3tag Version: 2.56



Hello,
is it possible to keep the old tag-value while importing when it's empty in the export-file?

Say I have a file with a tagged %artist% but non-present %title% and I'd export
CODE
%artist% - %title%

Then I'll get:
CODE
Artist -

Now, the other file I want to import it into already has both %artist% and %title% tagged. If I import this using the pattern from the export configuration, I'd end up with both %artist% and %title% overwritten, which I want for %artist%, but not for %title% that results in an empty/non-present tag.

Can I somehow check if the value in the export file is empty, and only import it when it's not?

EDIT: I just realized the same questions applies to the preview window when using a web source. It seems to work like I want it to for the release-section, but not for the tracks- and additional information-section.

This post has been edited by Kevin04: Apr 29 2012, 13:15
Go to the top of the page
 
+Quote Post
DetlevD
post Apr 29 2012, 13:55
Post #2


Member


Group: Full Members
Posts: 5031
Joined: 26-May 06
From: Wuppertal, Germany, Planet Earth
Member No.: 3194
Mp3tag Version: 2.63



QUOTE (Kevin04 @ Apr 29 2012, 14:05) *
Hello, is it possible to keep the old tag-value while importing when it's empty in the export-file? ... Can I somehow check if the value in the export file is empty, and only import it when it's not? ...

Although I did not quite understand your description in respect of export and import, I want to point to the pseudo placeholder %DUMMY%, which can help to exclude a certain value ​​from the import.

Beside that you are free to import any value into any temporary tag-field and make the decisions later, whether the imported value is useful or not, by using the Mp3tag filter or the scripting language or actions or converters and so on.

DD.20120429.1449.CEST


--------------------
* Beyond that, don't ask, when you don't know what to do with the answer. *
♥ home is where the heart is ♥
Go to the top of the page
 
+Quote Post
Kevin04
post Apr 29 2012, 15:10
Post #3


Member


Group: Full Members
Posts: 8
Joined: 13-January 11
Member No.: 13594
Mp3tag Version: 2.56



Well, I'll try to explain it in a more understandable way. Let's say we have two audiofiles, File 1 and File 2.

File 1 has %artist%=ARTIST1 and %title%=
So, %artist% has a value and %title% not/is non-present.

File 2 has %artist%=ARTIST2 and %title%=TITLE2
Both tags have a value.

If I use the below export pattern with File 1...
CODE
%artist% - %title%

... the resulting exportfile will look like:
CODE
ARTIST1 -

And if I now import the just exported textfile into File 2, I will end up with:

File 2 (imported values) has %artist%=ARTIST1 and %title%=
Both tags have been overwritten with the values from the export file.

However, since there's no value for %title%, I didn't want to import it in the first place, but keep the original value (TITLE2).

The file I want to get by importing is:
File 2 (intended values) has %artist%=ARTIST1 and %title%=TITLE2

I hope it makes more sense now...
Go to the top of the page
 
+Quote Post
DetlevD
post Apr 29 2012, 16:56
Post #4


Member


Group: Full Members
Posts: 5031
Joined: 26-May 06
From: Wuppertal, Germany, Planet Earth
Member No.: 3194
Mp3tag Version: 2.63



QUOTE (Kevin04 @ Apr 29 2012, 16:10) *
Well, I'll try to explain it in a more understandable way. Let's say we have two audiofiles, File 1 and File 2.
File 1 has %artist%=ARTIST1 and %title%=
So, %artist% has a value and %title% not/is non-present.
File 2 has %artist%=ARTIST2 and %title%=TITLE2
Both tags have a value.
If I use the below export pattern with File 1...
CODE
%artist% - %title%

... the resulting exportfile will look like:
CODE
ARTIST1 -

And if I now import the just exported textfile into File 2, I will end up with:
File 2 (imported values) has %artist%=ARTIST1 and %title%=
Both tags have been overwritten with the values from the export file.
However, since there's no value for %title%, I didn't want to import it in the first place, but keep the original value (TITLE2).
The file I want to get by importing is:
File 2 (intended values) has %artist%=ARTIST1 and %title%=TITLE2
I hope it makes more sense now...

Hm, I hope I understand, so you have currently an import mask string of ...
CODE
%artist% - %title%

... which tells Mp3tag to expect two tag-field items, separated by the delimiter string ' - '.

But you want to import only the first string item, so use an import mask string of ...
CODE
%artist% - %dummy%

... this should only import the first item, and discard the second item.

DD.20120329.1750.CEST


--------------------
* Beyond that, don't ask, when you don't know what to do with the answer. *
♥ home is where the heart is ♥
Go to the top of the page
 
+Quote Post
Kevin04
post Apr 29 2012, 18:04
Post #5


Member


Group: Full Members
Posts: 8
Joined: 13-January 11
Member No.: 13594
Mp3tag Version: 2.56



QUOTE (DetlevD @ Apr 29 2012, 17:56) *
Hm, I hope I understand, so you have currently an import mask string of ...
CODE
%artist% - %title%

... which tells Mp3tag to expect two tag-field items, separated by the delimiter string ' - '.

But you want to import only the first string item, so use an import mask string of ...
CODE
%artist% - %dummy%

... this should only import the first item, and discard the second item.

DD.20120329.1750.CEST


I know about %dummy%. The export pattern I presented was just a very simplified example, I don't actually use it. I export a whole lot more tags.
Determining which are empty and adjusting the import pattern accordingly (for each and every track too) would be extremely tedious. I could generate it automatically, yes, but I'd still have to import one track at a time then, since the pattern can change from track to track (just because track 1 has a PERFORMER doesn't mean track 2 does).
I can't change the export pattern to only include value+seperator when the tag has a value either, because then the amount of values in the export file would be variable and I'd have to adjust the import pattern again.

So the only convenient solution that comes to my mind would be to only import values longer than null from the export file (i.e., leave the tag unchanged if the value length is null).
Go to the top of the page
 
+Quote Post
DetlevD
post Apr 29 2012, 18:33
Post #6


Member


Group: Full Members
Posts: 5031
Joined: 26-May 06
From: Wuppertal, Germany, Planet Earth
Member No.: 3194
Mp3tag Version: 2.63



QUOTE (Kevin04 @ Apr 29 2012, 19:04) *
I know about %dummy%. The export pattern I presented was just a very simplified example, I don't actually use it. I export a whole lot more tags. ... I could generate it automatically, yes, ...

Once you are able to automate it, you can automate the whole process. ;-)

Hm, you have to think over the concept. I will just throw in some ideas.
Note: Before some data has not been imported into a tag-field MP3tag, Mp3tag cannot do any comparison of data.
There is no chance to compare the data, which is 'written on the file's paper', and the data, which is already stored in the target tag-field, or maybe not.
The only chance to control the import process 'half-automatic' is the usage of the %DUMMY% placeholder to discard selected data items while importing.

If you are familiar with the Mp3tag Scripting language, then you can import an entire line from the import text file into a temporary tag-field.
This can be done for all selected files at once resp. for all files grouped by filter.
Then use one or more dedicated actions "Guess values" to import the data into the related tag-fields.

It also seems to be possible to send a dedicated flag field into each line of the external text file while exporting, which later on can control the import process while guessing the values.

You have to find out how to handle the different cases of discarding dedicated items while importing.
Or fill tag-fields selectively, maybe function $if2 can help, anyway.

For me the best way would be to import all external data into a set of temporary fields, then use some actions to fill the target tag-fields, depending on their current content, then remove the temporary tag-fields.

DD.20120429.1952.CEST

This post has been edited by DetlevD: Apr 29 2012, 18:58


--------------------
* Beyond that, don't ask, when you don't know what to do with the answer. *
♥ home is where the heart is ♥
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 24th October 2014 - 16:25