View Issue Details

IDProjectCategoryView StatusLast Update
0014621MMW v4Framework: Scripts/Extensionspublic2018-01-19 21:32
Reporterpeke Assigned To 
PriorityhighSeverityfeatureReproducibilityN/A
Status closedResolutionfixed 
Target Version4.1.20 
Summary0014621: Search scripts: Ability to have multiple searches from one VBS
DescriptionCurrently for WEBSearch and scripts ini value "ProcName=SearchAMG" is never called and SearchAMG.vbs can't contain multiple search options or make init of setup websearch, instead "Sub StartSearch( Panel, SearchTerm, SearchArtist, SearchAlbum)" is directly called.

We should add that apron initiating WebSearch MMW should start "Sub SearchAMG( Panel, SearchTerm, SearchArtist, SearchAlbum)" and if "sub SearchAMG" doesn't exist in "FileName=SearchAMG.vbs" VBS then start "Sub StartSearch( Panel, SearchTerm, SearchArtist, SearchAlbum)" for backward compatibility.

Using http://www.mediamonkey.com/wiki/index.php/Sample_AMG_Search_script as example script for Framework.
TagsNo tags attached.
Fixed in build

Activities

peke

2018-01-19 03:29

developer   ~0049540

Last edited: 2018-01-19 03:35

Please triage, I think that there should be no regression risks for implementation.

I'm asking this as instead of separating MusicBrainz and Discogs searches to two separate scripts with this implementation existing one should be easily modified so that MMW have Two Searches instead of one.

here is a sample of the implementation in scripts.ini:
[SearchAMG1]
FileName=SearchAMG.vbs
ProcName=SearchAMG1
Order=10
DisplayName=Search All Music Guide 1
Language=VBScript
ScriptType=3

[SearchAMG1]
FileName=SearchAMG.vbs
ProcName=SearchAMG2
Order=10
DisplayName=Search All Music Guide 1
Language=VBScript
ScriptType=3

--- SearchAMG.vbs ----
Sub SearchAMG1(Panel, SearchTerm, SearchArtist, SearchAlbum)
 'set parameters fro AMG search 1
 '....
 'Execute actual Search
 StartSearch(Panel, SearchTerm, SearchArtist, SearchAlbum)
End Sub

Sub SearchAMG2(Panel, SearchTerm, SearchArtist, SearchAlbum)
 'set parameters fro AMG search 1
 '....
 'Execute actual Search
 StartSearch(Panel, SearchTerm, SearchArtist, SearchAlbum)
End Sub

Sub StartSearch(Panel, SearchTerm, SearchArtist, SearchAlbum)
 'Search Script
End Sub

---

Ludek

2018-01-19 09:24

developer   ~0049541

In case of auto-tag from web type scripts (ScriptType=3) there are actually three procedures called: 'StartSearch', 'ShowResults', 'FinishSearch'.
So we would need to give the choice to define all three in Scripts.ini, but I don't see a benefit. I don't understand the reason why one would want to join two scripts into one file?
i.e. what is point of joining MusicBrainz and Discogs into one script?

Also I don't agree that it is regression less change, there can be scripts that have the ProcName defined (together with 'StartSearch'), but StartSearch is supposed to be called. i.e. it could throws error for such a scripts.

I think that no change is required ATM. Resolving...

Ludek

2018-01-19 09:30

developer   ~0049542

I removed "ProcName=SearchAMG" from here: http://www.mediamonkey.com/wiki/index.php/Sample_AMG_Search_script so that it is not confusing.

peke

2018-01-19 21:31

developer   ~0049545

Last edited: 2018-01-19 21:31

As talked offline and from my tests you are right it is fairly easy to use multiple VBS files with single main VBS to have multi search engines in Options of Auto Tag from web.

As talked I confirmed my suspicion that http://www.mediamonkey.com/wiki/index.php/ISDBScriptControl::Include is the simplest solution for including/importing common VBS

Closing