Auto-Organise VS Friends Files

Get answers about using MediaMonkey 4 for Windows.

Moderator: Gurus

TheRocket
Posts: 84
Joined: Sat Jan 17, 2004 4:42 pm
Location: Quebec, Canada

Auto-Organise VS Friends Files

Post by TheRocket »

Hi,

I'm managing a Karaoke Mediamonkey Library. I use the Auto-Organize function to rename the mp3 files according to the tags, but Mediamonkey don't seem to view that there was a .cdg file with the .mp3 file... and it doesn't open a window to propose to rename those files as well...

I'm sure I'm missing a configuration somewhere, but I don't remember :-S

Any help?

Thanks
TheRocket
-- MMWBE 0.91 released! Get it here http://rocket.dyndns.info/mp3manager/mmwbe_v091.rar or see topic http://www.mediamonkey.com/forum/viewto ... 4005#34005 for more details!!!
Bex
Posts: 6316
Joined: Fri May 21, 2004 5:44 am
Location: Sweden

Post by Bex »

MM does currently not rename "accompanying files". It does however give you an option to move them if you move all your music files from one folder to another.

The missing feature has been requested though, read more here:
http://www.mediamonkey.com/forum/viewtopic.php?t=6491


/Bex
Advanced Duplicate Find & Fix Find More From Same - Custom Search. | Transfer PlayStat & Copy-Paste Tags/AlbumArt between any tracks.
Tagging Inconsistencies Do you think you have your tags in order? Think again...
Play History & Stats Node Like having your Last-FM account stored locally, but more advanced.
Case & Leading Zero Fixer Works on filenames too!

All My Scripts
TheRocket
Posts: 84
Joined: Sat Jan 17, 2004 4:42 pm
Location: Quebec, Canada

Well, if it is not provided, program it! :-P

Post by TheRocket »

Here is the script i use to rename / copy cdg files along with the mp3 file.

This script is still in beta version, no error handling is included.

If someone wants to improve it, let's go!

@MM programmers: the event OnBeforeTracksMove should also be fired when a file is deleted from mediamonkey? It would be a complete handling of friends files.

Code: Select all

Sub OnStartup
  Script.RegisterEvent SDB, "OnBeforeTracksMove", "SDBBeforeTracksMove"
End Sub 

'Sub OnBeforeTracksMove(Tracks As ISDBSongList, NewPaths As ISDBStringList, IsMove As Boolean)
Sub SDBBeforeTracksMove(Tracks, NewPaths, IsMove)
Dim progress 'As SDBProgress
Dim strCDGFile 'As String
Dim strNewCDGFile 'As String
Dim fso 'As Scripting.FileSystemObject

  Set progress = sdb.progress
  progress.Value = 0
  progress.MaxValue = Tracks.Count - 1
  Set fso = CreateObject("Scripting.FileSystemObject")
  
  For a = 0 To Tracks.Count - 1
    strCDGFile = RemoveExtension(Tracks.Item(a).Path) & ".cdg"
    strNewCDGFile = RemoveExtension(NewPaths.Item(a)) & ".cdg"

    'SDB.MessageBox "searching " & strCDGFile, mtError, Array(mbOk)

    If fso.FileExists(strCDGFile) Then
      'MoveExistingFile fso, strNewCDGFile, "(1)"
      'MoveExistingFile fso, NewPaths.Item(a), "(1)"
      If IsMove Then
        progress.Text = "Moving " & strCDGFile
        fso.MoveFile strCDGFile, strNewCDGFile
        'SDB.MessageBox "Moving " & strCDGFile & " to " &  strNewCDGFile, mtError, Array(mbOk)
      Else
        progress.Text = "Copying " & strCDGFile
        fso.CopyFile strCDGFile, strNewCDGFile, False
        'SDB.MessageBox "Copying " & strCDGFile & " to " &  strNewCDGFile, mtError, Array(mbOk)
      End If
    End If
    
    progress.Increase
    
  Next	
	
  Set Progress = Nothing	
	
End Sub
Function ExtractText(ByVal inText, ByVal inDebut, ByVal inFin)
    Dim pos1
    Dim pos2

    pos1 = InStr(1, inText, inDebut)
    If pos1 = 0 Then pos1 = 1 Else pos1 = pos1 + Len(inDebut)
    pos2 = InStr(pos1, inText, inFin)
    If pos2 < pos1 Then pos2 = Len(inText) + 1
    ExtractText = Mid(inText, pos1, pos2 - pos1)
    
End Function
Function ExtractTextInvert(ByVal inText, ByVal inDebut, ByVal inFin)
    ExtractTextInvert = StrReverse(ExtractText(StrReverse(inText), StrReverse(inDebut), StrReverse(inFin)))
End Function
Function GetExtension(strPath)
  GetExtension = ExtractTextInvert(strPath, "", ".")
  If GetExtension = strPath Then
    GetExtension = ""
  else
    GetExtension = "." & GetExtension
  End If
End Function
Function RemoveExtension(strPath)
  Dim StrTemp
  StrTemp = ExtractTextInvert(strPath, "", ".")
  if StrTemp = strPath then
    RemoveExtension = strPath
  else
    RemoveExtension = Left(strPath, Len(strPath) - Len(StrTemp) - 1)
  end if
End Function
Sub MoveExistingFile(fso, strNewFile, strAdd)
  If fso.FileExists(strNewFile) And Not fso.FileExists(RemoveExtension(strNewFile) & strAdd & GetExtension(strNewFile)) Then
    fso.MoveFile strNewFile, RemoveExtension(strNewFile) & strAdd & GetExtension(strNewFile)
  Elseif fso.FileExists(strNewFile) then
    MoveExistingFile fso, strNewFile, strAdd & "(1)"
  else
  End If
End Sub
TheRocket
-- MMWBE 0.91 released! Get it here http://rocket.dyndns.info/mp3manager/mmwbe_v091.rar or see topic http://www.mediamonkey.com/forum/viewto ... 4005#34005 for more details!!!
STabs
Posts: 37
Joined: Thu Aug 04, 2005 2:17 pm
Location: Scotland

Post by STabs »

Hi,
I have been using your script for some time and its fairly reliable, I have renamed 2000+ tracks succesfully. Have you done anymore scripts that are karaoke or mp3+cdg related?

Cheers, STabs
EAC -> Flac -> MediaMonkey -> Winamp = :-)
TheRocket
Posts: 84
Joined: Sat Jan 17, 2004 4:42 pm
Location: Quebec, Canada

Post by TheRocket »

Hi,

No, this is the only script that i use for karaoke. I have one plug-in for displaying the lyrics with winamp, and that's all...

Great if my script worked well for you!

TheRocket
TheRocket
-- MMWBE 0.91 released! Get it here http://rocket.dyndns.info/mp3manager/mmwbe_v091.rar or see topic http://www.mediamonkey.com/forum/viewto ... 4005#34005 for more details!!!
Post Reply