freedbSubmitter 2.6 [Updated 2021/07/06]

Post a reply

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

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

Topic review
   

Expand view Topic review: freedbSubmitter 2.6 [Updated 2021/07/06]

Re: freedbSubmitter 2.5 [Updated 2021/01/25]

by gbilley » Tue Jul 06, 2021 9:49 am

You helped a lot more than just saying 'nah, that didn't work!' The "missing file" bug was reported three years ago, but I never got enough information about the user's environment to discover what my mistake was. Your patience with the debugging process was essential to getting the problem solved. Same with the id collision bug. I truly appreciate your assistance.

Best of luck with your Python and JavaScript studies. Soon you'll be able to write your own MM5 addons!

Re: freedbSubmitter 2.5 [Updated 2021/01/25]

by Tippon » Mon Jul 05, 2021 9:10 pm

gbilley wrote: Sun Jul 04, 2021 11:21 am Thanks so much for leading me to a solution for the username-with-spaces issue. I'll get new and improved versions of freedbSubmitter, MonkeyBrainz, and DiscogsCSV online as soon as I can. But first, on to my next bone-head scripting error.

I think the solution will be to change line 655 to:

Code: Select all

temp = temp & "<p><a href='#' onclick='searchDiscid(" & category & "/" & discid & ")' hidefocus>View Details</a></p>"
The faulty code checks for disc collisions and is left over from the syntax used by the freedb.org website. When I switched to gnudb.org, I fixed the event handler, but not line 655 which calls the event handler. Part of the reason is because it's hard for me to check disc collisions.
It's working :)

I changed the code and launched MMW, and went through the steps to submit a CD. Everything worked as it should, and I had the option to submit the three discs I tried.

gbilley wrote: Sun Jul 04, 2021 11:21 am Be that as it may, is the Pilgrim CD a commercial disc, or has it been burned? If it's the latter, you may not want to submit that disc. Most music databases discourage or prohibit submitting burned CDs. You could submit it to MusicBrainz as a digital music release. After I fix the username bug in MonkeyBrainz, it should work for you.

FYI, I checked the Pilgrim discid in gnudb.org. It collides with an EP by a group called Pantera called Mouth of War. If you do submit it, you'll need to give it another freedb category (but you can leave the MM genre as Rock).
It's a professionally produced disc from an unsigned band, as is one of the others I tried. The main reason that I want to add discs is to put albums like these on, but I'm going to have to look into it more.

Both had conflicts, so I didn't submit them just in case. I tried the corrected version of Go Ahead Punk ...Make My Day, and was given the choice of the correct version or the incorrect version, so I selected the incorrect version and uploaded the changes. I've just checked, and the changes are showing on the site.

gbilley wrote: Sun Jul 04, 2021 11:21 am Thanks again for helping me track down my scripting bugs.
No problem :)

I'm just starting to learn Python and JavaScript, and I've needed plenty of help already, so it's nice to be able to help in some way, even if it's just going 'nah, that didn't work!' :D

Re: freedbSubmitter 2.5 [Updated 2021/01/25]

by gbilley » Sun Jul 04, 2021 11:21 am

Thanks so much for leading me to a solution for the username-with-spaces issue. I'll get new and improved versions of freedbSubmitter, MonkeyBrainz, and DiscogsCSV online as soon as I can. But first, on to my next bone-head scripting error.

I think the solution will be to change line 655 to:

Code: Select all

temp = temp & "<p><a href='#' onclick='searchDiscid(" & category & "/" & discid & ")' hidefocus>View Details</a></p>"
The faulty code checks for disc collisions and is left over from the syntax used by the freedb.org website. When I switched to gnudb.org, I fixed the event handler, but not line 655 which calls the event handler. Part of the reason is because it's hard for me to check disc collisions.

Be that as it may, is the Pilgrim CD a commercial disc, or has it been burned? If it's the latter, you may not want to submit that disc. Most music databases discourage or prohibit submitting burned CDs. You could submit it to MusicBrainz as a digital music release. After I fix the username bug in MonkeyBrainz, it should work for you.

FYI, I checked the Pilgrim discid in gnudb.org. It collides with an EP by a group called Pantera called Mouth of War. If you do submit it, you'll need to give it another freedb category (but you can leave the MM genre as Rock).

Thanks again for helping me track down my scripting bugs.

Re: freedbSubmitter 2.5 [Updated 2021/01/25]

by Tippon » Sat Jul 03, 2021 6:39 pm

We're definitely getting there!

I updated the vbs file and saved, then restarted MMW. I followed your guide to make sure I was doing everything correctly:
gbilley wrote: Sat Jun 26, 2021 11:21 am At this point, to submit the CD, you'd need to put the CD back in the drive; download track data from MusicBrainz; edit any data that needs fixing or enhancing; save the CD to the MM library (press the Insert key); then run freedbSubmitter (making sure the selected node is "CD:Pilgrim - Pilgrim").
and the freedbSubmitter window opened. It's identified the disc, and querying returns the expected error that the disc was not found. I selected the category, rock, and that's where it stops. Clicking either Preview Submission or Submit gives a script error.

Code: Select all

An error has occurred in the script on this page.
Line: 655
Char: 3
Error: Type mismatch: '[string: "<p><a href='#' oncli"]'
Code: 0
URL: file:///C:/Users?Ryan%20Davies/AppData/Roaming/MediaMonkey/Scripts/freedbSubmitter/freedbSubmitter.hta
Do you want to continue running scripts on this page?
Clicking yes or no makes no difference. The error message closes and nothing seems to happen.

I tried another CD, a commercial CD that should be in the database, and it worked. I used the 1996 compilation album, Go Ahead Punk, Make My Day. It's got two entries, and one of them is completely capitalised, with the year added to the album name. I corrected the capitalisation and album name, then went through the steps to submit the corrections. The preview and submission worked perfectly.

I've uploaded the screenshots here:

https://imgur.com/a/biidMcV

Re: freedbSubmitter 2.5 [Updated 2021/01/25]

by gbilley » Sat Jul 03, 2021 12:48 pm

Quite correct.

I should have said to replace just the Sub launchSubmitter subroutine in freedbSubmitter.vbs with the revised code. The rest of the .vbs file remains the same.

Thanks.

Re: freedbSubmitter 2.5 [Updated 2021/01/25]

by Tippon » Sat Jul 03, 2021 10:31 am

gbilley wrote: Tue Jun 29, 2021 11:18 am OMG, I think I committed the worst rookie coding mistake in the book! And once again, it was your latest screen shot that showed me the errors of my ways.

My error was assuming (or worse, not even considering) that everyone uses a one-word Windows user name (which just shows you how old-school I am).
I can guarantee that it's not as bad as the mistakes I've been making recently :oops: :D

I know what you mean about the usernames though. I never used my real name, let alone my full name, everything was Tippon. It's only since Windows 10 linked the licensing to Microsoft accounts that it changed. I didn't even realise until after setup finished and I hadn't put in a username.
gbilley wrote: Tue Jun 29, 2021 11:18 am If my realization is correct, using the following script in freedbSubmitter.vbs should fix the problem:

Code: Select all

Sub launchSubmitter
	Dim objShell, htaPath, cmd
	htaPath = "freedbSubmitter\freedbSubmitter.hta"
	Set objShell = CreateObject("WScript.Shell")
	cmd = """" & SDB.ScriptsPath & htaPath & """"
	objShell.Run cmd, 1, False
	Set objShell = Nothing
End Sub
If this fix works, my apologies to you and all the others who've wasted time on my faulty scripts. But my thanks and appreciation to you for sticking things out and helping me find a solution.

If the above fix doesn't work, then I'm totally befuddled.
Just to confirm, the new code replaces this bit, yeah?

Code: Select all

Sub launchSubmitter
	Dim objShell, htaPath
	htaPath = "freedbSubmitter\freedbSubmitter.hta"
	Set objShell = CreateObject("WScript.Shell")
	objShell.Run SDB.ScriptsPath & htaPath, 1, False
	Set objShell = Nothing
End Sub

Re: freedbSubmitter 2.5 [Updated 2021/01/25]

by gbilley » Tue Jun 29, 2021 11:18 am

OMG, I think I committed the worst rookie coding mistake in the book! And once again, it was your latest screen shot that showed me the errors of my ways.

My error was assuming (or worse, not even considering) that everyone uses a one-word Windows user name (which just shows you how old-school I am).

If my realization is correct, using the following script in freedbSubmitter.vbs should fix the problem:

Code: Select all

Sub launchSubmitter
	Dim objShell, htaPath, cmd
	htaPath = "freedbSubmitter\freedbSubmitter.hta"
	Set objShell = CreateObject("WScript.Shell")
	cmd = """" & SDB.ScriptsPath & htaPath & """"
	objShell.Run cmd, 1, False
	Set objShell = Nothing
End Sub
If this fix works, my apologies to you and all the others who've wasted time on my faulty scripts. But my thanks and appreciation to you for sticking things out and helping me find a solution.

If the above fix doesn't work, then I'm totally befuddled.

Re: freedbSubmitter 2.5 [Updated 2021/01/25]

by Tippon » Mon Jun 28, 2021 9:04 pm

gbilley wrote: Sat Jun 26, 2021 11:21 am From the screenshot, it looks as though your CD has not been entered into the MM database and library. In fact, no CDs have been entered. I'm guessing you ripped the CD with MM and then added your tag information to the ripped files.
Nope, I've always tagged then ripped, and I've ripped multiple CDs over the years. I always found that easier than ripping and then searching for the files to edit.
gbilley wrote: Sat Jun 26, 2021 11:21 am At this point, to submit the CD, you'd need to put the CD back in the drive; download track data from MusicBrainz; edit any data that needs fixing or enhancing; save the CD to the MM library (press the Insert key); then run freedbSubmitter (making sure the selected node is "CD:Pilgrim - Pilgrim").
This is pretty much how I've always done it, except I've never pressed Insert, I've always just ripped the CD, and I use FreeDB for track info. I've just done the following:

put the CD back in the drive
download track data from freedb (as there was no data for this CD, the info was read from the CD text)
edit any data that needs fixing or enhancing (none in this case)
save the CD to the MM library (press the Insert key)
then run freedbSubmitter (making sure the selected node is "CD:Pilgrim - Pilgrim").

I got the original error.

I had a horrible feeling that I hadn't tried another CD, so I tried Green Day - 21st Century Breakdown, and I still got the error.

https://imgur.com/a/10svY1b

Re: freedbSubmitter 2.5 [Updated 2021/01/25]

by gbilley » Sat Jun 26, 2021 11:21 am

A picture is indeed worth a thousand words. Thanks for the screenshot -- it explains a lot. And yes, the MM node naming conventions are adding to the confusion.

From the screenshot, it looks as though your CD has not been entered into the MM database and library. In fact, no CDs have been entered. I'm guessing you ripped the CD with MM and then added your tag information to the ripped files.

Here's a screenshot of how CD nodes appear in MM:

https://1drv.ms/u/s!AjhgeIYPVjLfiTMuwUE ... 3?e=kiYBFf

It's not possible to submit CDs to freedb from ripped files. Here's a link that goes into a bit more detail to why:

https://www.mediamonkey.com/forum/viewt ... 38#p467138

At this point, to submit the CD, you'd need to put the CD back in the drive; download track data from MusicBrainz; edit any data that needs fixing or enhancing; save the CD to the MM library (press the Insert key); then run freedbSubmitter (making sure the selected node is "CD:Pilgrim - Pilgrim").

Re: freedbSubmitter 2.5 [Updated 2021/01/25]

by Tippon » Fri Jun 25, 2021 7:55 pm

gbilley wrote: Tue Jun 22, 2021 9:27 am Basically, it sounds like you are trying to use the addon from a My Computer>CD node, instead of from a Music>Location>CD node. That's the node where you can see all the CDs in your library, whether they are online or off. The addon requires a Location>CD node to insure the CD is actually in the MM library and database, where it can access the info it needs to send to freedb (e.g., freedb discID and CD TOC).
I'm not using either of those. My CD shows up in the main media tree, at the same level as Music, Entire Library etc. It does appear under My Computer, but doesn't appear under either Music>Location, or Entire Library>Location. I'll add two screenshots.

This sounds more like the fault of MMW's confusing setup than anything else >.<

My CD drive is H:\, and the CD is Pilgrim in the screenshots:

https://imgur.com/a/BSC0oCv

Re: freedbSubmitter 2.5 [Updated 2021/01/25]

by gbilley » Tue Jun 22, 2021 9:27 am

Thanks again for all your testing and additional details. I think part of the problems you've experienced are due to my own inadequate understanding of MM node nomenclature and my inability to clearly convey the addon's requirements.

Basically, it sounds like you are trying to use the addon from a My Computer>CD node, instead of from a Music>Location>CD node. That's the node where you can see all the CDs in your library, whether they are online or off. The addon requires a Location>CD node to insure the CD is actually in the MM library and database, where it can access the info it needs to send to freedb (e.g., freedb discID and CD TOC).

So if you are on a My Computer>CD node, the error message is correct. Try selecting the same CD in its Music>Location>CD node location. It should work then.

In version 2.6, I'll try to make the error message a bit more clear and understandable to head off future confusion.

Regarding the script results, they indicate that everything is where it's supposed to be. Are you still getting an Error #-2147024894? If so, I'm totally mystified and can't even think of any other diagnostics to try.

Thanks again for all your help, patience, and perseverance.

Re: freedbSubmitter 2.5 [Updated 2021/01/25]

by Tippon » Mon Jun 21, 2021 12:13 pm

gbilley wrote: Fri Jun 11, 2021 11:22 am Thanks for all the additional info. It was indeed helpful.

The first thing that jumps out at me is the scripts.ini line that reads: Order=[the order number of your preference].

The text in that line should be a number. The installer creates the line as: Order=1. This config puts the addon at the top of the tools\scripts menu. If you'd like a different order, you can use whatever number you prefer.

Same goes for the MonkeyBrainz scripts.ini line: Order= 100 [or your preferred addon list order number].

The line should read: Order=100. Or the order number of your choice (but don't include the period).

Try making those two changes and let me know what happens.

Also, are you still on Windows 7 or have you moved on to Windows 10? Shouldn't make a difference, but might be good to know.

Thanks.
Sorry, it's my first chance to check in for a while, plus I needed to replace my optical drive.

I'm on Windows 10, fully updated. It's been a week or two out of date at the most while this has been going on. I've seen your recent posts, but checked the freedbSubmitter order line, and it's now correct. I must have either reinstalled or tried changing the line between our last posts. It's made no difference though.

Code: Select all

[freedbSubmitter]
Filename=freedbSubmitter\freedbSubmitter.vbs
Procname=launchSubmitter
Order=1
DisplayName=freedbSubmitter
Description=Submit new disc data to freedb or revise existing freedb data from MediaMonkey
Language=VBScript
ScriptType=0
Just copy the script and paste it into an empty text file. Name the file fdbsCheck.vbs. When you run the file, you'll see a dialog box with the script results. Press Ctrl-C to copy the dialog contents and send me the results. It will tell me if everything is where it should be. Here's what it looks like on my system:
I've just tried this and got the same results - all four lines say True.
You might also try an unreleased update, version 2.6. Here's a download link:
Sorry to say, I've just tried it and got the same error :(

My new optical drive is an external USB drive, so I'll give everything a try on the laptop later tonight and see how that goes :)

Re: freedbSubmitter 2.5 [Updated 2021/01/25]

by gbilley » Fri Jun 11, 2021 5:12 pm

I did a test to see if an invalid order value would cause any of your problems. Turns out, it does not. MM seems to just ignore the invalid value. If we get this script working on your system, you still might want to provide valid values so you get the result you want.

I did modify the manual install instructions to be a bit more clear and hopefully prevent this issue.

Your last post said the error you receive is Error #-2147024894. That would indicate a missing file. If you're not worn out yet, here's a small script that will give me more info about your config:

Code: Select all

dim fso, strOut, appData
Set objShell = WScript.CreateObject("WScript.Shell")
appData = objShell.ExpandEnvironmentStrings("%APPDATA%")
Set fso = WScript.CreateObject("Scripting.FileSystemObject")

strOut = "MM scripts.ini: " & fso.fileExists(appdata & "\mediamonkey\scripts\scripts.ini") & vbCr
strOut = strOut & "fdbs folder: " & fso.folderExists(appdata & "\mediamonkey\scripts\freedbsubmitter") & vbCr
strOut = strOut & "fdbs .hta file: " & fso.fileExists(appdata & "\mediamonkey\scripts\freedbsubmitter\freedbsubmitter.hta") & vbCr
strOut = strOut & "fdbs .vbs file: " & fso.fileExists(appdata & "\mediamonkey\scripts\freedbsubmitter\freedbsubmitter.vbs") & vbCr

msgbox strOut
Just copy the script and paste it into an empty text file. Name the file fdbsCheck.vbs. When you run the file, you'll see a dialog box with the script results. Press Ctrl-C to copy the dialog contents and send me the results. It will tell me if everything is where it should be. Here's what it looks like on my system:
---------------------------

---------------------------
MM scripts.ini: True
fdbs folder: True
fdbs .hta file: True
fdbs .vbs file: True

---------------------------
OK
---------------------------
Any false results would indicate a problem.

I also noticed that this line -- msgbox SDB.ScriptsPath & htaPath -- should be inside the Sub launchSubmitter block -- not outside. It's giving an inaccurate result there. You put it where my instructions said to, but in the intervening months, the app version changed and so did the line count. I should have done it this way:

Code: Select all

Sub launchSubmitter
	Dim objShell, htaPath
	htaPath = "freedbSubmitter\freedbSubmitter.hta"
	Set objShell = CreateObject("WScript.Shell")
	objShell.Run SDB.ScriptsPath & htaPath, 1, False
	Set objShell = Nothing
	msgbox SDB.ScriptsPath & htaPath
End Sub
You might also try an unreleased update, version 2.6. Here's a download link:

https://1drv.ms/u/s!AjhgeIYPVjLfiTE1Kyw ... 3?e=q6ELJe

Thanks for being so patient.

Re: freedbSubmitter 2.5 [Updated 2021/01/25]

by gbilley » Fri Jun 11, 2021 11:22 am

Thanks for all the additional info. It was indeed helpful.

The first thing that jumps out at me is the scripts.ini line that reads: Order=[the order number of your preference].

The text in that line should be a number. The installer creates the line as: Order=1. This config puts the addon at the top of the tools\scripts menu. If you'd like a different order, you can use whatever number you prefer.

Same goes for the MonkeyBrainz scripts.ini line: Order= 100 [or your preferred addon list order number].

The line should read: Order=100. Or the order number of your choice (but don't include the period).

Try making those two changes and let me know what happens.

Also, are you still on Windows 7 or have you moved on to Windows 10? Shouldn't make a difference, but might be good to know.

Thanks.

Re: freedbSubmitter 2.5 [Updated 2021/01/25]

by Tippon » Thu Jun 10, 2021 9:28 pm

Sorry, my turn to reply slowly :oops: :lol:

I'm definitely running 2.5 and running it from MMW. Just to confirm, running it from MMW gives me the message box, and running it from outside MMW gives me the selec a CD error.

This is my .vbs file:

Code: Select all

' Launches freedbSubmitter.hta and provides install capabilities

Sub launchSubmitter
	Dim objShell, htaPath
	htaPath = "freedbSubmitter\freedbSubmitter.hta"
	Set objShell = CreateObject("WScript.Shell")
	objShell.Run SDB.ScriptsPath & htaPath, 1, False
	Set objShell = Nothing
End Sub
msgbox SDB.ScriptsPath & htaPath

Sub Install
	Dim scriptName
	scriptName = "freedbSubmitter"

	Dim iniPath : iniPath = SDB.ScriptsPath & "Scripts.ini"
	Dim iniFile : Set iniFile = SDB.Tools.iniFileByPath(iniPath)

	If Not (iniFile Is Nothing) Then
		iniFile.StringValue(scriptName, "Filename") = "freedbSubmitter\freedbSubmitter.vbs"
		iniFile.StringValue(scriptName, "Procname") = "launchSubmitter"
		iniFile.StringValue(scriptName, "Order") = "1"
		iniFile.StringValue(scriptName, "DisplayName") = "freedbSubmitter"
		iniFile.StringValue(scriptName, "Description") = "Submit new disc data to freedb or revise existing freedb data from MediaMonkey"
		iniFile.StringValue(scriptName, "Language") = "VBScript"
		iniFile.StringValue(scriptName, "ScriptType") = "0"
		SDB.RefreshScriptItems
		Set iniFile = Nothing
	End If
End Sub


Sub Uninstall
	Dim iniSection
	iniSection = "freedbSubmitter"
	 
	Dim iniPath : iniPath = SDB.ScriptsPath & "Scripts.ini"
	Dim iniFile : Set iniFile = SDB.Tools.iniFileByPath(iniPath)

	If Not (iniFile Is Nothing) Then
	  iniFile.DeleteSection(iniSection)
	  iniFile.Flush
	  SDB.RefreshScriptItems
	  Set iniFile = Nothing
	End If
End Sub
and this is the relevant section from my scripts.ini ( I added the MonkeyBrainz section in case that helps):

Code: Select all

[freedbSubmitter]
Filename=freedbSubmitter\freedbSubmitter.vbs
Procname=launchSubmitter
Order=[the order number of your preference]
DisplayName=freedbSubmitter
Description=Submit disc metadata to freedb from MediaMonkey
Language=VBScript
ScriptType=0

[MonkeyBrainz]
Filename=MonkeyBrainz\MonkeyBrainz.vbs
Procname=launchMonkeyBrainz
Order= 100 [or your preferred addon list order number]
DisplayName=MonkeyBrainz
Description=Submit album data to MusicBrainz
Language=VBScript
ScriptType=0
I just tried moving the freedbSubmitter.vbs file to the scripts folder and updating the path in scripts.ini, as that's where some of my working scripts are, but that made no difference.

I've just deleted it and installed from your link, but I get the original error again - Error #-2147024894 - File: "C:\Users\username]\AppData\Roaming\MediaMonkey\Scripts\freedbSubmitter\freedbSubmitter.vbs", Line: 7, Column: 1

Top