Page 1 of 6

Missing Lyrics 1.3 - Update 11/01/2010

Posted: Wed Aug 23, 2006 3:25 am
by trixmoto
This is a new script which creates a node under 'Files To Edit' which lists all the tracks in your current filter which do not have lyrics. This can then be used with my "Lyric Timer" script to quickly import lyrics from EvilLyrics and timestamp them.

The installer is available to download from my website.

Code: Select all

'
' MediaMonkey Script
'
' NAME: MissingLyrics 1.3
'
' AUTHOR: trixmoto (http://trixmoto.net)
' DATE : 11/01/2010
'
' INSTALL: Copy to Scripts\Auto\MissingLyrics.vbs
'
' Thanks to Psyxonova, my SQL guru!
' Thanks to DiddeLeeDoo for his more efficient code
' Thanks to Bex for the current filter code
'
' FIXES: Removed old MM2 code
'        Fixed to only show tracks in the current filter
'

Option Explicit

Sub OnStartup
  Dim node : Set node = SDB.Objects("MissingLyricsNode")
  If Not (node Is Nothing) Then
    node.Visible = False
  End If
  Set node = SDB.MainTree.CreateNode
  node.Caption = "Unknown Lyrics"
  node.IconIndex = 36
  node.UseScript = Script.ScriptPath
  node.OnFillTracksFunct = "ShowUnknown"
  Call SDB.MainTree.AddNode(SDB.MainTree.Node_FilesToEdit,node,2)
  Set SDB.Objects("MissingLyricsNode") = node
End Sub

Sub ShowUnknown(node)
  Dim sql : sql = "WHERE Songs.Lyrics=''"
  If Not (SDB.Database.ActiveFilterQuery = "") Then 
    sql = sql&" AND "&SDB.Database.ActiveFilterQuery
  End If
  SDB.MainTracksWindow.AddTracksFromQuery(sql)
  SDB.MainTracksWindow.FinishAdding
End Sub

Posted: Wed Aug 23, 2006 1:37 pm
by nohitter151
thanks trix!! now my life is complete!

Posted: Mon Aug 28, 2006 9:10 am
by nohitter151
i found something weird.. i have this installed, it worked right away and showed the few songs i have without lyrics. i promptly found lyrics for them and pasted them into the properties, but 2 of my songs stay on the list even though i have lyrics for them. also, all of my tags have been sync'ed. why is it doing this?

Posted: Mon Aug 28, 2006 10:22 am
by DiddeLeeDoo
Trixmoto, you may want to try this as content in the sub

Code: Select all

    SQL="And Songs.ID IN (SELECT ID FROM Songs LEFT JOIN (SELECT IdSong FROM "&_
    "Memos WHERE MemoType=20000) As Lyr ON Songs.ID=Lyr.IdSong WHERE Lyr.IdSong Is Null)"
    SDB.MainTracksWindow.AddTracksFromQuery(SQL)
    SDB.MainTracksWindow.FinishAdding

Posted: Mon Aug 28, 2006 3:45 pm
by trixmoto
@nohitter - does restarting MM fix the problem?

@DiddleLeeDoo - thanks - I'll test this against mine for efficiency.

Posted: Mon Aug 28, 2006 3:48 pm
by trixmoto
New version (1.1) is now available form my website - with improved efficiency thanks to DiddeLeeDoo. :)

Posted: Mon Aug 28, 2006 3:54 pm
by nohitter151
no, i've restarted MM many times and the same 2 songs keep showing up. i'm going to try installing the new version, can i just install it right over the other one?

Posted: Mon Aug 28, 2006 5:10 pm
by Bex
Good spotted DiddeLeeDoo!

The SQL in the first post does not give desired result. It actually only gives songs that exist in the memos table (i.e. has comments) AND does not have lyrics. So songs that doesn't have any comments or lyrics will not be displayed. This is due to the INNER JOIN link between Songs and Memos.

To get around it you'll have to do it as DiddeLeeDoo did, with an inline veiw linked by the LEFT JOIN syntax. That applies for all occasions when you want to find songs that doesnt exist in tables, which are linked to the Songs table with "One to Many" relationship. (i.e. Memos, Played, AddSongInfo and AddSongInfoInt)

Another way, which is equally fast, is this:

Code: Select all

and not exists (select * from memos where memotype = 20000 and idsong=songs.id)
/Bex

Posted: Mon Aug 28, 2006 5:10 pm
by Teknojnky
You can also find files with no lyrics via auto-playlist:


Status is accessable
Lyrics equals ""

(leave lyrics value nothing)

and conversely, if you want to find files with lyrics, change the Lyrics equals, to does not equal.

Posted: Mon Aug 28, 2006 5:24 pm
by Bex
Or with Magic Nodes:

Code: Select all

Songs with no lyrics|SQL filter: not exists (select * from memos where memotype = 20000 and idsong=songs.id)\<Artist>

Posted: Mon Aug 28, 2006 5:53 pm
by DiddeLeeDoo
Gosh we're spoiled! ;)

Like that short version Bex!

Posted: Tue Aug 29, 2006 4:15 am
by trixmoto
I used to do this with auto playlists - but I don't want to play all my songs without lyrics so I don't want them in a playlist. They needed editing, so I want them in a Files To Edit node! :)

Yes, version 1.1 can be installed over 1.0 - and this should fix your problem as described above.

Posted: Tue Aug 29, 2006 8:00 am
by Bex
Yes, it's much nicer to have it in a Missing lyrics node!

Posted: Tue Aug 29, 2006 10:33 am
by DiddeLeeDoo
Did a tiny time test of the two SQLs and found that the two line one takes about 4 seconds and the one line one takes about 5 seconds.

Posted: Tue Aug 29, 2006 10:36 am
by trixmoto
I'll leave the script as it is for the time being then! Until one of you comes up with something even faster! :lol: