Update a new file with ALL tag information from an old file?

Post a reply

Smilies
:D :) :( :o :-? 8) :lol: :x :P :oops: :cry: :evil: :roll: :wink:

BBCode is ON
[img] is ON
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Update a new file with ALL tag information from an old file?

Re: Update a new file with ALL tag information from an old file?

by gem45 » Thu Sep 17, 2009 5:05 am

It works here for me now.Thanks for the infos.

by Bex » Thu Jul 19, 2007 3:49 pm

Trixmoto and I have implemented Copy/Paste metadata in my Dupe script:

Image

It can copy all MM-supported Tags, Album Art, PlayHistory, PlayCount, DateAdded and Playlist-entries between any tracks. It can even copy tags and Album art between files not in library.

Get it here:
http://www.mediamonkey.com/forum/viewtopic.php?t=13000

by kdo » Sun Apr 01, 2007 6:30 pm

Exactly what I needed! Simple, and works like a charm.
Many many thanks!
:D

by Al_G » Wed Jul 26, 2006 12:12 am

MCSmarties wrote:Nevertheless, I would use this script many times as I got a ton of songs I would like to re-rip in a better quality than I did 5 years ago!
I wanted to re-rip my CDs too, and I ended up following the steps outlined above by Wolfgang. His guide was really helpful (thanks Wolfgang!). It took a couple months to do about 800 discs. It helped having two CD drives running at the same time. One extra step I added was using foobar2000 to add replaygain (album) values to the FLAC files, with file monitor picking up the changes in MM.

by MCSmarties » Tue Jul 25, 2006 10:30 am

Steegy: I apologize if you were waiting all this time for feedback that never came!

What can I say, I was really busy these past few months and didn't get a chance to play with my Monkey at all! :roll:

I have looked at your script suggestion but not being a scripter myself I don't understand all of it. I think I get the gist though.

Some thoughts:

1. the most important fields would be LYRICS and COMMENTS, followed by the "description" fields such as Tempo, Situation, Mood, Rating...
After all, the other fields can be easily obtained when looking up tags, the problem are the fields with personal or customized information.

2. How about being able to select 2 directories and get the script to *suggest* a correlation based on the file name (or existing tags)?
That way one could re-tag entire albums in one go.

3. This is going to be outside the scope of a script.
An idea I have floated around on this forum some time ago would be a small application that can copy ALL ID3 frames
(based on the ID3v2 specifications, not their implementation in a particular tagger) from one track to another.
If the user could then remap these tags to "fit" a particular application, all "compatibility" issues would be taken care of!

You are right that the *way* how the script would work is not important.
Nevertheless, I would use this script many times as I got a ton of songs I would like to re-rip in a better quality than I did 5 years ago!

by Steegy » Wed Apr 19, 2006 8:16 am

Actually, a Ctrl-C, Ctrl-V alike solution is also very similar.

Concept:
Add context menu item "Copy Tag Information Ctrl-Shift-C" and "Paste Tag Information Ctrl-Shift-V" and link these 2 items to 2 different script methods like GetSelectedSonglistAndSaveToSDBObjectsArray and SaveSDBObjectsArraySonglistToSelectedSonglist.

It's all almost the same. It just depends on how you would like it to be implemented.

BTW: We are still talking about a "not so much happening problem" isn't it? So the script has to work, but the way how isn't really important probably (as you will probably only use the script once, and then forget about it).

Cheers
Steegy

by Steegy » Wed Apr 19, 2006 7:57 am

It's also very easy to make a script that first asks to select the "from" tracks an then the "to" tracks.

Code: Select all

Dim mySongListFrom, mySongListTo

Sub Main
  If SelectTracksFrom Then
    'GIVE THE USER A MESSAGE AND THE CHANCE TO SELECT OTHER TRACKS TO SAVE THE TAGS TO
    If SDB.MessageBox("Select tracks to save tags to, please.", mtInformation, Array(mbOk, mbCancel)) = mrOk Then
      If SelectTracksTo Then
        CopyTagDataBetweenSonglists(mySongListFrom, mySongListTo)
      End If
    End If
  End If
End Sub

Function SelectTracksFrom
  SelectTracksFrom = False
  Set mySongListFrom = SDB.SelectedSongList

  If MySongListFrom.Count = 0 Then 
    Set MySongListFrom = SDB.AllVisibleSongList 
    If MySongListFrom.Count = 0 Then 
      SDB.MessageBox "Nothing selected!", mtError, Array(mbOK) 
      Exit Function 
    End If 
  End If

  SelectTracksFrom = True
End Function

Function SelectTracksTo
  SelectTracksTo = False
  Set mySongListTo = SDB.SelectedSongList

  If MySongListTo.Count = 0 Then 
    Set MySongListTo = SDB.AllVisibleSongList 
    If MySongListTo.Count = 0 Then 
      SDB.MessageBox "Nothing selected!", mtError, Array(mbOK) 
      Exit Sub 
    End If 
  End If

  If MySongListTo.Count = MySongListFrom.Count Then SelectTracksTo = True
End Function
  
Sub CopyTagDataBetweenSonglists(SLFrom, SLTo)
  Dim i, SongFrom, SongTo 
  For i = 0 To SLFrom.Count - 1
      Set SongFrom = SLFrom.Item(i)
      Set SongTo = SLTongList.Item(i)
      
      '.... The same as always...

  Next
End Sub
BTW, I'm aware of the not-so-good coding technique (using global variables where it's not necessary) so I could have let the functions return the SDBSongLists instead of the booleans, but it's just the concept. I didn't actually test the script so I wanted to keep it very easy.

However, it probably isn't far away from a working script. Maybe someone can test it?

Cheers
Steegy

by trixmoto » Wed Apr 19, 2006 4:12 am

This is possible, and if I wasn't in the middle of several other scripts at the moment (and 3 skins as well, although I haven't given them any time for weeks) I would give it a go. It should be possible to simply take all the database fields from one track and apply that information to another. I'm not sure about copying every tag though. This would be more of an application than a script, although it would be possible.

by MCSmarties » Tue Apr 18, 2006 8:04 pm

Thanks a lot for the replies, Steegy and the others.
I know it's lame to keep asking others to write scripts and I really apologize for that.

I did some more searching and found a tagger called "Abander TagControl".
It doesn't look too bad to tell the truth, but it's no match for the Monkey.

However, it does have a nifty feature: the option to copy/past ENTIRE TAGS from a file.
Of course it only copies the fields that it supports. Since it supports only about half
the fields that Media Monkey does, it's not that great of a solution.

But it does give an interesting idea! The way it works in TagControl is that using
CTRL+C on a file copies all tag information, CTRL+V then pastes it somewhere else.
It can also export the tag to a bunch of formats (.tag, .csv, .txt).

Adapting that for a script, how about if one could open 2 directories side by side
(similar to explorer windows) and then just copy/paste tags from one side to the other?

by Teknojnky » Tue Apr 18, 2006 2:41 pm

I wonder if an "IMPORT" type function could solve this issue and the issue of changing drive/volume id's (Ie moving files to a new computer/drive).

by Pablo » Tue Apr 18, 2006 2:36 pm

I've been thinking of writing such a script, but I see some issues with AlbumArt and such. But I'll give it some more thought.

by wolfzell » Tue Apr 18, 2006 2:33 pm

Thanks for your help, steegy.

I started converting only after I found a method to re-rip while keeping the old info, only it needs a lot of manual steps and such methods are error-prone if you have to do them for 1000 albums, but I try to explain the way that I am doing it right now:

1. I have all my music sorted this way:
D:/MP3/<Album Artist>/<Album>/<Track #> - <Title> - <Artist>.mp3

2. I use MM's convert feature to convert all the tracks to *.flac with the same directory scheme, but naming them only <Track #>.flac. Now I have all entries two times in MM's database. One time with the mp3 extension and one time with the flac extension.

3. I delete all files in D:/MP3/ named ??.flac which kills the converted FLAC-files, but keeps the MP3 files just for safety right now.

4. I use EAC with the FLAC-encoder and rip the album, telling EAC to name the tracks just with the track#. (=??.flac). When EAC wants to save the files, I point it to the directory of that album. This way the tag info in the ripped file may be retrieved from freedb, but that does not matter.

5. After EAC has ripped the album, I go to the album in MM, delete the MP3 files, press Ctrl-A (select all), Ctrl-S (synchronize tags, this way writing MM's info into the new ripped files) and Ctrl-R (rename files, with the old naming scheme of the mp3-files).

This way I know exactly which files are already done. Still this is error prone if I ever point EAC to a wrong directory.

It would be much easier if everything could be done in MM. Just insert the CD, select re-rip, and let the computer do the rest.

Well, but at least I found a way to keep my old info (including cover art). All I am losing are the connections to the playlists, so I will have do build them up all over again after the format conversion. I could have exported and imported them (after correcting them) again, but I forgot that at the beginning. Right now many mp3-files are already missing and so are the entries in the playlists for them... :(

bye
Wolfgang

by Steegy » Tue Apr 18, 2006 1:33 pm

Script suggestion based on the concept:

Code: Select all

Option Explicit

Sub CopyTagDataWithinPairs

  Dim mySongList
      Set mySongList = SDB.SelectedSongList

  If MySongList.Count = 0 Then
    Set MySongList = SDB.AllVisibleSongList
    If MySongList.Count = 0 Then
      SDB.MessageBox "Nothing selected!", mtError, Array(mbOK)
      Exit Sub
    End If
  End If
  
  Dim i, SongFrom, SongTo
  For i = 0 To mySongList.Count - 1 Step 2
      Set SongFrom = mySongList.Item(i) 'first song is the old one to get the tags from
      Set SongTo = mySongList.Item(i + 1) 'second song is the new one to write the data to
      
      ''Set SongTo.Album = SongFrom.Album
      ''Set SongTo.AlbumArt = SongFrom.AlbumArt
      SongTo.AlbumArtistName = SongFrom.AlbumArtistName
      SongTo.AlbumName = SongFrom.AlbumName
      ''Set SongTo.Artist = SongFrom.Artist
      SongTo.ArtistName = SongFrom.ArtistName
      SongTo.Author = SongFrom.Author
      
      SongTo.Band = SongFrom.Band
      SongTo.BPM = SongFrom.BPM
      SongTo.Comment = SongFrom.Comment
      SongTo.Conductor = SongFrom.Conductor
      SongTo.Copyright = SongFrom.Copyright
      SongTo.Custom1 = SongFrom.Custom1
      SongTo.Custom2 = SongFrom.Custom2
      SongTo.Custom3 = SongFrom.Custom3
      SongTo.Genre = SongFrom.Genre
      SongTo.InvolvedPeople = SongFrom.InvolvedPeople
'...
'... more to add...
'...

' I obviously didn't add things like DateAdded and Encoder

' What about copying objects like AlbumArt?

' Could the method GetCopy be used?

      SongTo.UpdateAlbum
      SongTo.UpdateArtist
      SongTo.UpdateDB
      SongTo.WriteTags

  Next

End Sub
This is just a basic "idea", so please other scripters, if you have time, please take a look at it (and improve it, or make it work (I didn't test))


Again, the script does what is mentioned here: http://www.mediamonkey.com/forum/viewto ... 2601#42601
Nothing else! So just use it for testing a bit... It's not safe!!


Another selection like "Old1, Old2, Old3, Old4, New1, New2, New3, New4" can also easily be made.
Just change

Code: Select all

  For i = 0 To mySongList.Count - 1 Step 2
      Set SongFrom = mySongList.Item(i) 'first song is the old one to get the tags from
      Set SongTo = mySongList.Item(i + 1) 'second song is the new one to write the data to
to

Code: Select all

  For i = 0 To mySongList.Count/2 - 1
      Set SongFrom = mySongList.Item(i) 'first song is the old one to get the tags from
      Set SongTo = mySongList.Item(i + mySongList.Count/2) 'second song is the new one to write the data to
Cheers
Steegy

by Steegy » Tue Apr 18, 2006 1:14 pm

I thought I read and answered a request like this in the past: http://www.mediamonkey.com/forum/viewto ... =copy+tags

Does what I proposed you there sound a good way to do? (it's certainly very easy, both for user and scripter)?

by rovingcowboy » Tue Apr 18, 2006 12:17 pm

sorry you are upset wolfzell.

but there is a new scripter in the group now and he is good.

and looking for ideas maybe he will pick this up.

of course his wife might get mad if he gets lost in code so

he might take his time at it too.. :) 8)

Top