Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Option Explicit
- '
- ' Discogs Tagger Script for MediaMonkey ( Let & eepman & crap_inhuman )
- '
- Const VersionStr = "v5.77"
- 'Changes from 5.76 to 5.77 by crap_inhuman in 10.2020
- ' Added option to show the qty of release format in format tag (i.e. 2 x CD)
- 'Changes from 5.75 to 5.76 by crap_inhuman in 09.2020
- ' Bug with additional images while tagging one track removed
- ' Option to choose matching engine added
- 'Changes from 5.74 to 5.75 by crap_inhuman in 05.2020
- ' Some changes made in matching method
- 'Changes from 5.73 to 5.74 by crap_inhuman in 04.2020
- ' The following chars ´ , ` , ’ , ‘ , ” , “ are replaced by '
- ' Fixed tracknumber bug
- ' Changed the matching method (Thanks to DJ Samhein)
- 'Changes from 5.72 to 5.73 by crap_inhuman in 04.2020
- ' Fixed trackname-bug
- ' A ’ will now replaced by ' , too
- 'Changes from 5.71 to 5.72 by crap_inhuman in 04.2020
- ' Added option to replace a ´ and ` with a '
- ' Added option to search at Metal-Archives.com
- ' Removed issues with multi-disc albums, need MediaMonkey Version 4.1.28.1905 or above
- 'Changes from 5.70 to 5.71 by crap_inhuman in 09.2019
- ' Small bugfix from new release yesterday
- 'Changes from 5.69 to 5.70 by crap_inhuman in 09.2019
- ' Bug removed: Track-numbering didn't work with more than one char in rare cases
- 'Changes from 5.68 to 5.69 by crap_inhuman in 07.2019
- ' Added 'Video' to the CD tag list
- 'Changes from 5.67 to 5.68 by crap_inhuman in 05.2019
- ' Now the track-numbering start with the Disc-numbering
- 'Changes from 5.66 to 5.67 by crap_inhuman in 05.2019
- ' Changed the Side to Disc function (2 Vinyl sides are one disc)
- ' Added a "Deselect all" button
- 'Changes from 5.65 to 5.66 by crap_inhuman in 04.2019
- ' Changed the Authorize links to work with Windows 10
- 'Changes from 5.64 to 5.65 by crap_inhuman in 04.2019
- ' Added option to change media format separator
- 'Changes from 5.63 to 5.64 by crap_inhuman in 11.2018
- ' Bug removed with mixed media format
- ' Select Grouping (not ready yet)
- ' Add Start/Stop button for track refresh
- 'Changes from 5.62 to 5.63 by crap_inhuman in 09.2018
- ' Musicbrainz: New Bug in Label subroutine removed
- 'Changes from 5.61 to 5.62 by crap_inhuman in 09.2018
- ' Musicbrainz: Bug removed: Label with no name stop the script
- 'Changes from 5.60 to 5.61 by crap_inhuman in 07.2018
- ' Bug removed: Format checkbox didn't work
- 'Changes from 5.59 to 5.60 by crap_inhuman in 06.2018
- ' Added new option to store the name of grouped tracks into the grouping tag
- ' Added changeable separator for sub-tracks
- 'Changes from 5.58 to 5.59 by crap_inhuman in 04.2018
- ' The script now use secure channel (https) while fetching data
- ' Workaround for Discogs date of master release bug: date is now empty instead number 0
- 'Changes from 5.57 to 5.58 by crap_inhuman in 02.2018
- ' Repaired the artist tagging
- 'Changes from 5.56 to 5.57 by crap_inhuman in 02.2018
- ' Choose artist for tagging back to his old place
- ' Choose Track# and Disc# for tagging back on the main window
- 'Changes from 5.55 to 5.56 by crap_inhuman in 02.2018
- ' Changed some visual things to be more user-friendly
- ' Authorize the Discogs Tagger should now be more user-friendly
- ' Every individual genre and style can now selected
- ' Bug removed: if last track is a sub-track, it didn't recognized as sub-track
- ' Updating the track titles can now be turned off
- 'Changes from 5.54 to 5.55 by crap_inhuman in 01.2018
- ' Now choose your favourite tagger (Discogs or MusicBrainz) from options in the right upper corner
- ' Bug removed: a slash (/) in folder-names will not stop the script anymore
- 'Changes from 5.53 to 5.54 by crap_inhuman in 12.2017
- ' Discogs Tagger use the title-name of the first selected track for search at Discogs, if no album name was found
- 'Changes from 5.52 to 5.53 by crap_inhuman in 12.2017
- ' Improved identification of Release/Master/Label/Artist Discogs Numbers e.g. [r12345], [m12345], [l12345], [a12345]
- ' Fixed identification of master url
- 'Changes from 5.51 to 5.52 by crap_inhuman in 09.2017
- ' Now check status-code while image download
- ' Return to 'MSXML2.ServerXMLHTTP.6.0' for MusicBrainz search
- ' Improved some code
- 'Changes from 5.50 to 5.51 by crap_inhuman in 09.2017
- ' Secure channel error: Replaced all 'MSXML2.ServerXMLHTTP.6.0' with 'MSXML2.XMLHTTP.6.0'
- 'Changes from 5.49 to 5.50 by crap_inhuman in 09.2017
- ' Secure channel error: Replaced 'MSXML2.ServerXMLHTTP.6.0' with 'MSXML2.XMLHTTP.6.0' for image download
- ' Added third option for date field
- 'Changes from 5.48 to 5.49 by crap_inhuman in 08.2017
- ' Changed the 'where to store date' option
- 'Changes from 5.47 to 5.48 by crap_inhuman in 06.2017
- ' Added forgotten blank
- ' Added "Ignore featuring artist" option
- 'Changes from 5.46 to 5.47 by crap_inhuman in 06.2017
- ' Added the feature "Add leading zero (Disc#)"
- 'Changes from 5.45 to 5.46 by crap_inhuman in 05.2017
- ' Skip Extra-Artists without artistname in musicbrainz-tagger
- ' Changed Musicbrainz logo
- ' "Feat."-Function repaired
- ' Searching at Musicbrainz should now be better
- 'Changes from 5.44 to 5.45 by crap_inhuman in 11.2016
- ' Bug with leading zero removed
- ' Added option for limiting releases
- 'Changes from 5.43 to 5.44 by crap_inhuman in 11.2016
- ' Bug with Release Date / Original Date removed
- ' In Advanced Search hitting enter will trigger search
- ' Changed error message if no release found
- 'Changes from 5.42 to 5.43 by crap_inhuman in 11.2016
- ' Leading/Trailing spaces will now detected and deleted in album-name, too.
- ' Changing the release will reset the selected tracks
- ' Added option for choosing where to store Release Date/Original Date
- 'Changes from 5.41 to 5.42 by crap_inhuman in 10.2016
- ' Leading/Trailing spaces will now detected and deleted in track-names and the release number
- ' will be send to mysql db, a busy bee will then fix it at Discogs (Hopefully) ;)
- 'Changes from 5.40 to 5.41 by crap_inhuman in 10.2016
- ' Small bugfixes
- 'Changes from 5.39 to 5.40 by crap_inhuman in 06.2016
- ' Discogs: Removed bug with featuring artist in the albumartist
- ' Musicbrainz: Removed one of the two blank character in featuring artist
- ' Trackname removed from first search
- 'Changes from 5.38 to 5.39 by crap_inhuman in 04.2016
- ' The check if it's already in Discogs Collection can be turned off
- ' Added option to delete duplicated entries in tags
- 'Changes from 5.37 to 5.38 by crap_inhuman in 03.2016
- ' Redirected back to my webspace
- ' Added new feature: Add the selected album to your Discogs Collection
- 'Changes from 5.36a to 5.37 by crap_inhuman in 03.2016
- ' Changed the authorize script
- 'Changes from 5.36 to 5.36a by crap_inhuman in 03.2016
- ' Changed from HTTP to HTTPS - using free webspace discogstagger.hol.es
- 'Changes from 5.35 to 5.36 by crap_inhuman in 01.2016
- ' Bug with empty Label removed
- 'Changes from 5.34 to 5.35 by crap_inhuman in 01.2016
- ' Changed feat. Artist function: Now you can use ";" for separator
- ' Fixed some Artist-Separator bugs
- 'Changes from 5.33 to 5.34 by crap_inhuman in 01.2016
- ' Artist search now use discogs artist-id
- 'Changes from 5.32 to 5.33 by crap_inhuman in 12.2015
- ' Added advanced search button
- ' Added option: Move The in artist name to the end
- 'Changes from 5.31 to 5.32 by crap_inhuman in 12.2015
- ' Search improved for more accurate results
- 'Changes from 5.30 to 5.31 by crap_inhuman in 11.2015
- ' Choose what kind of search after entering search string
- 'Changes from 5.29 to 5.30 by crap_inhuman in 11.2015
- ' Fixed new bug with ampersand
- 'Changes from 5.28 to 5.29 by crap_inhuman in 10.2015
- ' Added Relationship-Attributes for Musicbrainz Credits
- ' Fixed bug with additional musicbrainz images
- ' Added support for foreign characters
- ' Fixed bug with ampersand in artistname
- 'Changes from 5.27 to 5.28 by crap_inhuman in 07.2015
- ' Removed bug with unselecting tracks
- 'Changes from 5.26 to 5.27 by crap_inhuman in 07.2015
- ' Removed bug with joint artists
- 'Changes from 5.25 to 5.26 by crap_inhuman in 07.2015
- ' Comma removed after artist
- 'Changes from 5.24 to 5.25 by crap_inhuman in 06.2015
- ' Comment Tag added to the Release info
- ' Back to original Cover-Image saving-routine
- ' Easier Discogs authorization
- 'Changes from 5.23 to 5.24 by crap_inhuman in 04.2015
- ' Added check for image before try download it.
- ' Image-Proxy removed
- 'Changes from 5.22 to 5.23 by crap_inhuman in 03.2015
- ' Again a saving cover-image bug removed
- 'Changes from 5.21 to 5.22 by crap_inhuman in 03.2015
- ' Bug removed: mm hangs while downloading covers
- ' Bug removed: the tags will be written, while cover is saving
- ' The common filename masks are implemented (Title, Artist, AlbumArtist,…)
- 'Changes from 5.20 to 5.21 by crap_inhuman in 03.2015
- ' Saving cover-image bug removed
- 'Changes from 5.19 to 5.20 by crap_inhuman in 03.2015
- ' Removed CheckImmedSaveImage, the image(s) will now saved immediately
- ' Changed Cover-Image saving-routine to store the images in the cache
- 'Changes from 5.18 to 5.19 by crap_inhuman in 03.2015
- ' Changed Image download due to recent changes on accessing images at discogs
- ' Added check for new version once a day
- 'Changes from 5.17 to 5.18 by crap_inhuman in 02.2015
- ' Removed bug with Catalog/Release tag
- ' Removed bug with featuring artist
- 'Changes from 5.16 to 5.17 by crap_inhuman in 01.2015
- ' Choosing "Master-Release" shows the Master-Release. Yes, really. ;)
- ' Choosing "Versions of Master" shows all Versions (Releases) of the selected Master-Release.
- ' If you selected a Release, the corresponding Master of this Release will choosen.
- ' Added ISRC to CatalogTag
- 'Changes from 5.15 to 5.16 by crap_inhuman in 01.2015
- ' Removed bug with Extra-Artists
- 'Changes from 5.14 to 5.15 by crap_inhuman in 01.2015
- ' MusicBrainz: Tags with no value will no longer crash the script
- ' MusicBrainz: The manual search now works
- ' MusicBrainz: Some options which are not necessary are now hidden
- ' Some small bugfixes
- 'Changes from 5.13 to 5.14 by crap_inhuman in 11.2014
- ' The Tagger now detect OAuth authentication error
- 'Changes from 5.12 to 5.13 by crap_inhuman in 11.2014
- ' More than one space between track positions doesn't stop the script anymore ;)
- ' Changed subtrack error detection
- 'Changes from 5.11 to 5.12 by crap_inhuman in 10.2014
- ' Removed a bug with empty keyword fields in the options menu
- ' Now only the search requests use oauth
- 'Changes from 5.10 to 5.11 by crap_inhuman in 10.2014
- ' New option "Save selected 'more images' after closing popup" fixed
- ' New option "Don't copy empty values to non-empty fields" now works for genres/styles too
- ' More Debug Output to Logfile
- 'Changes from 5.01 to 5.10 by crap_inhuman in 10.2014
- ' Changed unclear text
- ' Change order in dropdown list of the search result, put label at the end
- ' Added option to enter unwanted tags in involved people
- ' Added option to save selected "More images" after closing the popup
- ' Added option "Don't copy empty values to non-empty fields"
- ' Now show the TrackCount of every release in the search result (only with musicbrainz)
- ' Some small changes to the layout
- 'Changes from 5.0 to 5.01 by crap_inhuman in 09.2014
- ' Removed bug with search result
- ' Removed bug if no release found
- 'Changes from 4.52 to 5.0 by crap_inhuman in 09.2014
- ' Changed OAuth Authorization procedure (now wait 30 seconds for authorize)
- ' Added MusicBrainz for searching
- ' Removed some small bugs
- 'Changes from 4.51 to 4.52 by crap_inhuman in 08.2014
- ' Changed OAuth Authorization procedure
- 'Changes from 4.50 to 4.51 by crap_inhuman in 07.2014
- ' Removed bug with & character in searchstring
- ' Small bugfixes
- ' Removed bug with empty results
- 'Changes from 4.48 to 4.50 by crap_inhuman in 07.2014
- ' Bug removed with utf-8 characters in searchstring (with big help from tillmanj !!)
- 'Changes from 4.47 to 4.48 by crap_inhuman in 07.2014
- ' In the options menu you can now enter the access token manually
- ' Bug removed in Keywords routine
- 'Changes from 4.46 to 4.47 by crap_inhuman in 07.2014
- ' Changed the Delay - Function, WScript.sleep didn't work on all windows plattforms.
- 'Changes from 4.45 to 4.46 by crap_inhuman in 07.2014
- ' The default settings for saving the Cover Images can now be changed in the options menu
- ' Bug removed: Empty format-tag produced an error
- ' Bug removed: Parsing wrong Artist Roles if a comma is between box bracket
- ' Added OAuth authentication
- ' Added option: Using Metal-Archives for release search (BETA)
- ' Now it's possible to use * as wildcard in the Keywords
- ' Added option: Print every involved people in a single line
- 'Changes from 4.44 to 4.45 by crap_inhuman in 05.2014
- ' Bug removed: Didn't display the additional Image
- ' Adjust the script for fetching the small album art
- ' Adjust the script for removing leading and trailing spaces in Extra Artists
- ' Add option to turn off subtrack detection
- 'Changes from 4.43 to 4.44 by crap_inhuman in 04.2014
- ' Added simple routine to check and remove point in track positions (1. , 2. , 3. )
- ' Bug removed: track position part
- ' Max count for releases is set to 250
- 'Changes from 4.42 to 4.43 by crap_inhuman in 04.2014
- ' Bug removed: Filter now work correctly
- ' There's no max count for release results
- ' Bug removed: Artist releases and Label releases work again
- 'Changes from 4.41 to 4.42 by crap_inhuman in 03.2014
- ' Bug removed: Sub-Track do not select(set) the song
- ' Added the option for switching the last artist separator ("&" or "chosen separator")
- 'Changes from 4.40 to 4.41 by crap_inhuman in 03.2014
- ' Removed bug with more than one artist for a title
- ' Added Artist separator to options menu
- ' Added simple routine to check for false position separators
- 'Changes from 4.39 to 4.40 by crap_inhuman in 03.2014
- ' featuring Keywords are now not case sensitive
- 'Changes from 4.38 to 4.39 by crap_inhuman in 03.2014
- ' Keywords are now not case sensitive
- ' Added Set Locale for supporting more countries
- 'Changes from 4.37 to 4.38 by crap_inhuman in 02.2014
- ' Added the Featuring Keywords
- ' Fixed a bug with the new submission form of discogs
- 'Changes from 4.36 to 4.37 by crap_inhuman in 02.2014
- ' Changed the image access method
- 'Changes from 4.35 to 4.36 by crap_inhuman in 11.2013
- ' The script now shows the filtered total and the matched total
- 'Changes from 4.34 to 4.35 by crap_inhuman in 11.2013
- ' Raise the max count of release results to 100
- ' Display the number of matched releases and which one you are viewing in the search bar
- 'Changes from 4.33 to 4.34 by crap_inhuman in 11.2013
- ' Now it's possible to change the search string in the top bar
- 'Changes from 4.32 to 4.33 by crap_inhuman in 10.2013
- ' Fixed a bug with the Separator
- 'Changes from 4.31 to 4.32 by crap_inhuman in 10.2013
- ' Removed bug in extra artist assignment
- ' Added 'Don't save' and 4 more fields for saving release-number
- 'Changes from 4.30 to 4.31 by crap_inhuman in 09.2013
- ' Removed bug: Sub track name will not recognized if it is the last track
- ' Removed bug: Script-Error occurred after closing the script-window, when no release found
- ' Background of filter dropdown menu change to red if filter is selected (For better recognition)
- 'Changes from 4.00 to 4.30 by crap_inhuman in 07-09.2013
- ' Added Sub tracks option.
- ' Added option 'Unselect tracks without track-number'
- ' Some albums at discogs have 'Index-Tracks'.
- ' These tracks aren't song-tracks (e.g. Track-Name: 'Bonus track' or 'Live side')
- ' This option unselect these tracks automatically
- ' -------------------------------------------------------
- ' Show a warning if the number of songs are different
- ' For the catalog-number, release-country and media-format you can choose "Don't save" in the option menu, if you don't need it.
- ' You can edit the keywords for linking the composer, producer, conductor,... tags with discogs
- ' included DiscogsImages: you can choose more than one image for an album
- ' New Option: Check 'Save Image' Checkbox only if release have no image
- ' New Option: Choose another field for saving Style
- 'Changes from 3.65 to 4.00 by crap_inhuman in 07.2013
- ' Bug removed with releases having leading zero in track-position
- ' Added option for "Force NO Disc Usage". Helpful if a release have tracks with varying track-numbers (e.g. http://www.discogs.com/release/2942314 )
- ' Without the option the script translate the varying track position to disc sides
- ' Added option to show the original discogs track position
- ' Moved the options to the left side for more place for the tracklisting
- ' Moving the mouse-pointer over a checkbox now show more information about the usage
- ' Now the chosen filters will be saved with the options
- ' Choose one MediaType, MediaFormat, Country or Year from the drop-down list and save the options
- ' or press one of the "Set ... Filter" button to select more than one Mediatype, MediaFormat, Country or Year
- ' Choosing "Use ... Filter" in the drop-down list uses the custom filter-settings
- ' Choosing "No ... Filter" from the drop-down list stop filtering the result
- ' The Filter settings will only be saved if you press the "Save Options" button
- ' The Custom Tags for saving the release, catalog, country and format will now be chosen in the options -> Discogs Tagger or during script installation
- ' Showing the Data Quality of the Discogs release
- 'Changes from 3.64 to 3.65 by crap_inhuman in 07.2013
- ' Bug removed: bug with additional artists removed, which only occur in rare cases
- 'Changes from 3.63 to 3.64 by crap_inhuman in 06.2013
- ' Bug removed: selecting "Sides To Disc" and "Add Leading Zero", zero is dropped from track number and is displayed as a single digit
- 'Changes from 3.62 to 3.63 by crap_inhuman in 02.2013 (not released)
- ' Bug removed: no search result -> no output
- 'Changes from 3.61 to 3.62 by crap_inhuman in 02.2013
- ' Insert code for supporting french language machines
- ' Comments will now be saved
- ' Delete some unused but declared variables
- ' Name for "feat." can be edit
- ' Some small bugfixes
- 'Changes from 3.6 to 3.61 by crap_inhuman in 02.2013
- ' Removed a bug in the option 'Featuring Artist behind title'
- ' Better implementation of the option 'Featuring Artist behind title'
- ' Inserting Master and Release URLs now work in the Search-Panel
- 'Changes from 3.5 to 3.6 by crap_inhuman in 02.2013
- ' Implementation of eepman's JSON-Parser
- ' Now read the user-specific Separator characters and use it for separating
- ' Label / Artist / Master Search now using the JSON Parser too
- ' Some bugfixes
- 'Changes from 3.3 to 3.5 by crap_inhuman in 01.2013
- ' Now you can choose which Custom Tag will be used for the Tags: ReleaseID, Catalog, Country and Format
- ' The "Credits for ExtraArtists in tracks" will now saved in MediaMonkey !
- ' Added option for "Add Leading zero to Tracknumbers"
- ' Added option for "Include Producer"
- ' Added JSON Parser for the new Discogs-API
- ' Some bugfixes (Filter now working correct)
- ' Added the option to choose the place for Featuring Artist (Artist or Title)
- ' e.g. Aaliyah - We Need a Resolution (ft. Timbaland) -or- Aaliyah (ft. Timbaland) - We Need a Resolution
- ' Changeable Name for "Various" Artists (Various Artists)
- ' Added option for "Adding comment"
- ' Get OriginalDate from Master-Release if available
- ' The Script now reads the saved Discogs Release-ID from the chosen Release-Tag
- ' ToDo: Add more tooltips to the html
- ' Mediamonkey Bug: Erster und letzter Buchstabe in SearchArtist fehlt (wenn nächster Buchstabe blank ist e.g. "3 doors down", "Miss may i")
- ' Wrong Publisher, Producer, etc. in Subtracks. The script only take the info from the first subtrack..
- ' Adding Artist-Alias in Musicbrainz search
- ' WebBrowser is visible browser object with display of discogs album info
- Dim WebBrowser
- ' decoded json object representing currently selected release
- Dim CurrentRelease, QueryPage
- Dim UI
- Dim Results, ResultsReleaseID, NewResult
- Dim CurrentReleaseId, CurrentResultId
- Dim ini
- Dim CheckAlbum, CheckArtist, CheckAlbumArtist, CheckAlbumArtistFirst, CheckLabel, CheckDate, CheckOrigDate, CheckGenre
- Dim CheckCountry, CheckCover, CheckSmallCover, SmallCover, CheckStyle, CheckCatalog, CheckRelease, CheckInvolved, CheckLyricist, CheckGrouping
- Dim CheckComposer, CheckConductor, CheckProducer, CheckDiscNum, CheckTrackNum, CheckFormat, CheckUseAnv, CheckYearOnlyDate, CheckReplaceAccentChar
- Dim CheckForceNumeric, CheckSidesToDisc, CheckForceDisc, CheckNoDisc, CheckLeadingZero, CheckLeadingZeroDisc, CheckVarious, TxtVarious
- Dim CheckTitleFeaturing, CheckComment, CheckFeaturingName, TxtFeaturingName, CheckOriginalDiscogsTrack, CheckSaveImage, CheckLimitReleases
- Dim CheckStyleField, CheckTurnOffSubTrack, CheckInvolvedPeopleSingleLine, CheckDontFillEmptyFields, CheckTheBehindArtist, CheckNewMatchingEngine
- Dim CheckDiscogsCollectionOff, CheckDeleteDuplicatedEntry, StoreDate, OriginalDateRead, ReleaseDateRead
- Dim CheckIgnoreFeatArtist, CheckShowQtyFormat, SubTrackSeparator, trackRefresh, DiffNumberTracks
- REM Dim CheckUserCollection
- Dim DiscogsUsername, GUID
- Dim SubTrackNameSelection
- Dim CountryFilterList, MediaTypeFilterList, MediaFormatFilterList, YearFilterList
- Dim LyricistKeywords, ConductorKeywords, ProducerKeywords, ComposerKeywords, FeaturingKeywords, UnwantedKeywords
- Dim SavedReleaseId
- Dim NewSearchTerm, NewSearchArtist, NewSearchAlbum, NewSearchTrack
- Dim SavedSearchArtist, SavedSearchAlbum
- Dim SavedMasterID, SavedArtistID, SavedLabelID
- Dim FilterMediaType, FilterCountry, FilterYear, FilterMediaFormat, CurrentLoadType
- Dim NewGenre, GenresList, GenresSelect
- Dim MediaTypeList, MediaFormatList, CountryList, CountryCode, YearList, AlternativeList, LoadList, RelationAttrList
- Dim FormatSeparator, ArtistSeparator, ArtistLastSeparator, LimitReleases, Grouping
- Dim FirstTrack, Errormessage
- Dim AlbumArtURL, AlbumArtThumbNail
- Dim iMaxTracks
- Dim iAutoTrackNumber, iAutoDiscNumber, iAutoDiscFormat
- Dim LastDisc
- Dim SelectAll
- Dim UnselectedTracks(1000)
- Dim UnselectedTrackNames(1000)
- Dim CheckNewVersion, LastCheck
- Dim DiscTrackOrder1()
- Dim DiscTrackOrder2()
- Dim DiscTrackOrder3()
- Dim NewTrackOrder()
- Dim NewTrackOrder2()
- Dim NewTrackOrder3()
- Dim ReleaseTag, CountryTag, CatalogTag, FormatTag
- Dim OriginalDate, Separator
- Dim OptionsChanged, UserAgent
- Dim AccessToken, AccessTokenSecret
- Dim fso, loc, logf
- REM QueryPage = "Discogs"
- REM QueryPage = "MusicBrainz"
- REM QueryPage = "MetalArchives"
- REM SearchFor = 1 = Artist
- REM SearchFor = 2 = Album
- REM SearchFor = 3 = Release
- '----------------------------------DiscogsImages----------------------------------------
- Dim SaveImageType, SaveImage, CoverStorage, CoverStorageName
- Dim FileNameList, ImageTypeList, ImageList, ImageLocal
- Dim list
- Dim ImagesCount
- Dim SaveMoreImages
- Dim WebBrowser3
- Dim SelectedSongsGlobal
- Set ImageTypeList = SDB.NewStringList
- ImageTypeList.Add SDB.Localize("Not specified") '0
- ImageTypeList.Add SDB.Localize("Cover (front)") '3
- ImageTypeList.Add SDB.Localize("Cover (back)") '4
- ImageTypeList.Add SDB.Localize("Leaflet Page")
- ImageTypeList.Add SDB.Localize("Media Label")
- ImageTypeList.Add SDB.Localize("Lead Artist")
- ImageTypeList.Add SDB.Localize("Artist")
- ImageTypeList.Add SDB.Localize("Conductor")
- ImageTypeList.Add SDB.Localize("Band")
- ImageTypeList.Add SDB.Localize("Composer")
- ImageTypeList.Add SDB.Localize("Lyricist")
- ImageTypeList.Add SDB.Localize("Recording Location")
- ImageTypeList.Add SDB.Localize("During Recording")
- ImageTypeList.Add SDB.Localize("During Performance")
- ImageTypeList.Add SDB.Localize("Video Screen Capture")
- ImageTypeList.Add SDB.Localize("Illustration")
- ImageTypeList.Add SDB.Localize("Band Logotype")
- ImageTypeList.Add SDB.Localize("Publisher Logotype") '20
- '----------------------------------DiscogsImages----------------------------------------
- ' Easier access of SDB.UI
- Set UI = SDB.UI
- Dim sTemp
- sTemp = SDB.TemporaryFolder
- ' MediaMonkey calls this method whenever a search is started using this script
- Sub StartSearchType(Panel, SearchTerm, SearchArtist, SearchAlbum, SearchType)
- Dim tmpCountry, tmpCountry2, tmpMediaType, tmpMediaType2, tmpMediaFormat, tmpMediaFormat2, tmpYear, tmpYear2
- Dim i, a, tmp, ret
- Set CountryFilterList = SDB.NewStringList
- Set MediaTypeFilterList = SDB.NewStringList
- Set MediaFormatFilterList = SDB.NewStringList
- Set YearFilterList = SDB.NewStringList
- OptionsChanged = False
- NewResult = True
- If SearchType = 1 Then QueryPage = "Discogs"
- If SearchType = 2 Then QueryPage = "MusicBrainz"
- If SearchType = 3 Then QueryPage = "MetalArchives"
- '*FilterList.Item(0) = "0" -> No Filter
- '*FilterList.Item(0) = "1" -> Custom Filter
- '*FilterList.Item(0) = "2" -> Selected Country/MediaType/MediaFormat/Year
- Set ini = SDB.IniFile
- If Not (ini Is Nothing) Then
- 'We init default settings only if they do not exist in ini file yet
- If ini.StringValue("DiscogsAutoTagWeb","CheckAlbum") = "" Then
- ini.BoolValue("DiscogsAutoTagWeb","CheckAlbum") = True
- End If
- If ini.StringValue("DiscogsAutoTagWeb","CheckArtist") = "" Then
- ini.BoolValue("DiscogsAutoTagWeb","CheckArtist") = True
- End If
- If ini.StringValue("DiscogsAutoTagWeb","CheckAlbumArtist") = "" Then
- ini.BoolValue("DiscogsAutoTagWeb","CheckAlbumArtist") = True
- End If
- If ini.StringValue("DiscogsAutoTagWeb","CheckAlbumArtistFirst") = "" Then
- ini.BoolValue("DiscogsAutoTagWeb","CheckAlbumArtistFirst") = False
- End If
- If ini.StringValue("DiscogsAutoTagWeb","CheckLabel") = "" Then
- ini.BoolValue("DiscogsAutoTagWeb","CheckLabel") = True
- End If
- If ini.StringValue("DiscogsAutoTagWeb","CheckDate") = "" Then
- ini.BoolValue("DiscogsAutoTagWeb","CheckDate") = True
- End If
- If ini.StringValue("DiscogsAutoTagWeb","CheckOrigDate") = "" Then
- ini.BoolValue("DiscogsAutoTagWeb","CheckOrigDate") = False
- End If
- If ini.StringValue("DiscogsAutoTagWeb","CheckGenre") = "" Then
- ini.BoolValue("DiscogsAutoTagWeb","CheckGenre") = False
- End If
- If ini.StringValue("DiscogsAutoTagWeb","CheckStyle") = "" Then
- ini.BoolValue("DiscogsAutoTagWeb","CheckStyle") = True
- End If
- If ini.StringValue("DiscogsAutoTagWeb","CheckCountry") = "" Then
- ini.BoolValue("DiscogsAutoTagWeb","CheckCountry") = True
- End If
- If ini.StringValue("DiscogsAutoTagWeb","CheckSaveImage") = "" Then
- ini.StringValue("DiscogsAutoTagWeb","CheckSaveImage") = 1
- End If
- If ini.StringValue("DiscogsAutoTagWeb","CheckSmallCover") = "" Then
- ini.BoolValue("DiscogsAutoTagWeb","CheckSmallCover") = False
- End If
- If ini.StringValue("DiscogsAutoTagWeb","CheckCatalog") = "" Then
- ini.BoolValue("DiscogsAutoTagWeb","CheckCatalog") = True
- End If
- If ini.StringValue("DiscogsAutoTagWeb","CheckRelease") = "" Then
- ini.BoolValue("DiscogsAutoTagWeb","CheckRelease") = True
- End If
- If ini.StringValue("DiscogsAutoTagWeb","CheckInvolved") = "" Then
- ini.BoolValue("DiscogsAutoTagWeb","CheckInvolved") = False
- End If
- If ini.StringValue("DiscogsAutoTagWeb","CheckGrouping") = "" Then
- ini.BoolValue("DiscogsAutoTagWeb","CheckGrouping") = False
- End If
- If ini.StringValue("DiscogsAutoTagWeb","CheckLyricist") = "" Then
- ini.BoolValue("DiscogsAutoTagWeb","CheckLyricist") = False
- End If
- If ini.StringValue("DiscogsAutoTagWeb","CheckComposer") = "" Then
- ini.BoolValue("DiscogsAutoTagWeb","CheckComposer") = False
- End If
- If ini.StringValue("DiscogsAutoTagWeb","CheckConductor") = "" Then
- ini.BoolValue("DiscogsAutoTagWeb","CheckConductor") = False
- End If
- If ini.StringValue("DiscogsAutoTagWeb","CheckProducer") = "" Then
- ini.BoolValue("DiscogsAutoTagWeb","CheckProducer") = False
- End If
- If ini.StringValue("DiscogsAutoTagWeb","CheckDiscNum") = "" Then
- ini.BoolValue("DiscogsAutoTagWeb","CheckDiscNum") = True
- End If
- If ini.StringValue("DiscogsAutoTagWeb","CheckTrackNum") = "" Then
- ini.BoolValue("DiscogsAutoTagWeb","CheckTrackNum") = True
- End If
- If ini.StringValue("DiscogsAutoTagWeb","CheckFormat") = "" Then
- ini.BoolValue("DiscogsAutoTagWeb","CheckFormat") = True
- End If
- If ini.StringValue("DiscogsAutoTagWeb","CheckUseAnv") = "" Then
- ini.BoolValue("DiscogsAutoTagWeb","CheckUseAnv") = False
- End If
- If ini.StringValue("DiscogsAutoTagWeb","CheckYearOnlyDate") = "" Then
- ini.BoolValue("DiscogsAutoTagWeb","CheckYearOnlyDate") = False
- End If
- If ini.StringValue("DiscogsAutoTagWeb","CheckForceNumeric") = "" Then
- ini.BoolValue("DiscogsAutoTagWeb","CheckForceNumeric") = False
- End If
- If ini.StringValue("DiscogsAutoTagWeb","CheckSidesToDisc") = "" Then
- ini.BoolValue("DiscogsAutoTagWeb","CheckSidesToDisc") = False
- End If
- If ini.StringValue("DiscogsAutoTagWeb","CheckForceDisc") = "" Then
- ini.BoolValue("DiscogsAutoTagWeb","CheckForceDisc") = False
- End If
- If ini.StringValue("DiscogsAutoTagWeb","CheckNoDisc") = "" Then
- ini.BoolValue("DiscogsAutoTagWeb","CheckNoDisc") = False
- End If
- If ini.StringValue("DiscogsAutoTagWeb","CheckOriginalDiscogsTrack") = "" Then
- ini.BoolValue("DiscogsAutoTagWeb","CheckOriginalDiscogsTrack") = False
- End If
- REM If ini.StringValue("DiscogsAutoTagWeb","CheckUserCollection") = "" Then
- REM ini.BoolValue("DiscogsAutoTagWeb","CheckUserCollection") = False
- REM End If
- If ini.StringValue("DiscogsAutoTagWeb","ReleaseTag") = "" Then
- ini.StringValue("DiscogsAutoTagWeb","ReleaseTag") = "Custom2"
- End If
- If ini.StringValue("DiscogsAutoTagWeb","CatalogTag") = "" Then
- ini.StringValue("DiscogsAutoTagWeb","CatalogTag") = "Custom3"
- End If
- If ini.StringValue("DiscogsAutoTagWeb","CountryTag") = "" Then
- ini.StringValue("DiscogsAutoTagWeb","CountryTag") = "Custom4"
- End If
- If ini.StringValue("DiscogsAutoTagWeb","FormatTag") = "" Then
- ini.StringValue("DiscogsAutoTagWeb","FormatTag") = "Custom5"
- End If
- If ini.StringValue("DiscogsAutoTagWeb","CheckLeadingZero") = "" Then
- ini.BoolValue("DiscogsAutoTagWeb","CheckLeadingZero") = True
- End If
- If ini.StringValue("DiscogsAutoTagWeb","CheckLeadingZeroDisc") = "" Then
- ini.BoolValue("DiscogsAutoTagWeb","CheckLeadingZeroDisc") = False
- End If
- If ini.StringValue("DiscogsAutoTagWeb","CheckVarious") = "" Then
- ini.BoolValue("DiscogsAutoTagWeb","CheckVarious") = False
- End If
- If ini.StringValue("DiscogsAutoTagWeb","TxtVarious") = "" Then
- ini.StringValue("DiscogsAutoTagWeb","TxtVarious") = "Various Artists"
- End If
- If ini.StringValue("DiscogsAutoTagWeb","CheckTitleFeaturing") = "" Then
- ini.BoolValue("DiscogsAutoTagWeb","CheckTitleFeaturing") = True
- End If
- If ini.StringValue("DiscogsAutoTagWeb","CheckFeaturingName") = "" Then
- ini.BoolValue("DiscogsAutoTagWeb","CheckFeaturingName") = True
- End If
- If ini.StringValue("DiscogsAutoTagWeb","TxtFeaturingName") = "" Then
- ini.StringValue("DiscogsAutoTagWeb","TxtFeaturingName") = "feat."
- End If
- If ini.StringValue("DiscogsAutoTagWeb","CheckComment") = "" Then
- ini.BoolValue("DiscogsAutoTagWeb","CheckComment") = True
- End If
- If ini.StringValue("DiscogsAutoTagWeb","SubTrackNameSelection") = "" Then
- ini.BoolValue("DiscogsAutoTagWeb","SubTrackNameSelection") = False
- End If
- If ini.StringValue("DiscogsAutoTagWeb","CurrentCountryFilter") = "" Then
- tmp = "0"
- For a = 1 To 262
- tmp = tmp & ",0"
- Next
- ini.StringValue("DiscogsAutoTagWeb","CurrentCountryFilter") = tmp
- End If
- If ini.StringValue("DiscogsAutoTagWeb","CurrentMediaTypeFilter") = "" Then
- tmp = "0"
- For a = 1 To 38
- tmp = tmp & ",0"
- Next
- ini.StringValue("DiscogsAutoTagWeb","CurrentMediaTypeFilter") = tmp
- End If
- If ini.StringValue("DiscogsAutoTagWeb","CurrentMediaFormatFilter") = "" Then
- tmp = "0"
- For a = 1 To 48
- tmp = tmp & ",0"
- Next
- ini.StringValue("DiscogsAutoTagWeb","CurrentMediaFormatFilter") = tmp
- End If
- If ini.StringValue("DiscogsAutoTagWeb","CurrentYearFilter") = "" Then
- tmp = "0"
- For a = Year(Date) To 1900 Step -1
- tmp = tmp & ",0"
- Next
- ini.StringValue("DiscogsAutoTagWeb","CurrentYearFilter") = tmp
- End If
- If ini.StringValue("DiscogsAutoTagWeb","LyricistKeywords") = "" Then
- ini.StringValue("DiscogsAutoTagWeb","LyricistKeywords") = "Lyrics By,Words By"
- End If
- If ini.StringValue("DiscogsAutoTagWeb","ConductorKeywords") = "" Then
- ini.StringValue("DiscogsAutoTagWeb","ConductorKeywords") = "Conductor"
- End If
- If ini.StringValue("DiscogsAutoTagWeb","ProducerKeywords") = "" Then
- ini.StringValue("DiscogsAutoTagWeb","ProducerKeywords") = "Producer,Arranged By,Recorded By"
- End If
- If ini.StringValue("DiscogsAutoTagWeb","ComposerKeywords") = "" Then
- ini.StringValue("DiscogsAutoTagWeb","ComposerKeywords") = "Composed By,Score,Written-By,Written By,Music By,Programmed By,Songwriter"
- End If
- If ini.StringValue("DiscogsAutoTagWeb","FeaturingKeywords") = "" Then
- ini.StringValue("DiscogsAutoTagWeb","FeaturingKeywords") = "featuring,feat.,ft.,ft ,feat ,Rap,Rap [Featuring],Vocals [Featuring]"
- End If
- If ini.StringValue("DiscogsAutoTagWeb","UnwantedKeywords") = "" Then
- ini.StringValue("DiscogsAutoTagWeb","UnwantedKeywords") = ""
- End If
- If ini.StringValue("DiscogsAutoTagWeb","CheckStyleField") = "" Then
- ini.StringValue("DiscogsAutoTagWeb","CheckStyleField") = "Default (stored with Genre)"
- End If
- If ini.StringValue("DiscogsAutoTagWeb","ArtistSeparator") = "" Then
- ini.StringValue("DiscogsAutoTagWeb","ArtistSeparator") = ", "
- End If
- If ini.StringValue("DiscogsAutoTagWeb","ArtistLastSeparator") = "" Then
- ini.BoolValue("DiscogsAutoTagWeb","ArtistLastSeparator") = True
- End If
- If ini.StringValue("DiscogsAutoTagWeb","FormatSeparator") = "" Then
- ini.StringValue("DiscogsAutoTagWeb","FormatSeparator") = ", "
- End If
- If ini.StringValue("DiscogsAutoTagWeb","CheckTurnOffSubTrack") = "" Then
- ini.BoolValue("DiscogsAutoTagWeb","CheckTurnOffSubTrack") = False
- End If
- If ini.ValueExists("DiscogsAutoTagWeb","CheckNotAlwaysSaveimage") Then
- ini.DeleteKey "DiscogsAutoTagWeb","CheckNotAlwaysSaveimage"
- End If
- If ini.StringValue("DiscogsAutoTagWeb","AccessToken") = "" Then
- ini.StringValue("DiscogsAutoTagWeb","AccessToken") = ""
- End If
- If ini.StringValue("DiscogsAutoTagWeb","AccessTokenSecret") = "" Then
- ini.StringValue("DiscogsAutoTagWeb","AccessTokenSecret") = ""
- End If
- REM If ini.StringValue("DiscogsAutoTagWeb","QueryPage") = "" Then
- REM ini.StringValue("DiscogsAutoTagWeb","QueryPage") = "Discogs"
- REM End If
- If ini.StringValue("DiscogsAutoTagWeb","CheckInvolvedPeopleSingleLine") = "" Then
- ini.BoolValue("DiscogsAutoTagWeb","CheckInvolvedPeopleSingleLine") = False
- End If
- If ini.StringValue("DiscogsAutoTagWeb","CheckDontFillEmptyFields") = "" Then
- ini.BoolValue("DiscogsAutoTagWeb","CheckDontFillEmptyFields") = True
- End If
- If ini.StringValue("DiscogsAutoTagWeb","CheckNewVersion") = "" Then
- ini.BoolValue("DiscogsAutoTagWeb","CheckNewVersion") = True
- End If
- If ini.StringValue("DiscogsAutoTagWeb","LastCheck") = "" Then
- ini.StringValue("DiscogsAutoTagWeb","LastCheck") = "1"
- End If
- If ini.StringValue("DiscogsAutoTagWeb","CheckTheBehindArtist") = "" Then
- ini.BoolValue("DiscogsAutoTagWeb","CheckTheBehindArtist") = False
- End If
- If ini.StringValue("DiscogsAutoTagWeb","DiscogsUsername") = "" Then
- ini.StringValue("DiscogsAutoTagWeb","DiscogsUsername") = ""
- End If
- If ini.StringValue("DiscogsAutoTagWeb","CheckDiscogsCollectionOff") = "" Then
- ini.BoolValue("DiscogsAutoTagWeb","CheckDiscogsCollectionOff") = True
- End If
- If ini.StringValue("DiscogsAutoTagWeb","CheckDeleteDuplicatedEntry") = "" Then
- ini.BoolValue("DiscogsAutoTagWeb","CheckDeleteDuplicatedEntry") = False
- End If
- If ini.StringValue("DiscogsAutoTagWeb","StoreDate") = "" Then
- ini.StringValue("DiscogsAutoTagWeb","StoreDate") = 0
- End If
- If ini.ValueExists("DiscogsAutoTagWeb","StoreOrgDate") Then
- ini.DeleteKey "DiscogsAutoTagWeb","StoreOrgDate"
- End If
- If ini.StringValue("DiscogsAutoTagWeb","LimitReleases") = "" Then
- ini.StringValue("DiscogsAutoTagWeb","LimitReleases") = 0
- End If
- If ini.StringValue("DiscogsAutoTagWeb","CheckIgnoreFeatArtist") = "" Then
- ini.BoolValue("DiscogsAutoTagWeb","CheckIgnoreFeatArtist") = False
- End If
- If ini.StringValue("DiscogsAutoTagWeb","SubTrackSeparator") = "" Then
- ini.StringValue("DiscogsAutoTagWeb","SubTrackSeparator") = ", "
- End If
- If ini.StringValue("DiscogsAutoTagWeb","CheckReplaceAccentChar") = "" Then
- ini.BoolValue("DiscogsAutoTagWeb","CheckReplaceAccentChar") = False
- End If
- If ini.StringValue("DiscogsAutoTagWeb","CheckNewMatchingEngine") = "" Then
- ini.BoolValue("DiscogsAutoTagWeb","CheckNewMatchingEngine") = True
- End If
- If ini.StringValue("DiscogsAutoTagWeb","CheckShowQtyFormat") = "" Then
- ini.BoolValue("DiscogsAutoTagWeb","CheckShowQtyFormat") = False
- End If
- '----------------------------------DiscogsImages----------------------------------------
- CoverStorage = ini.StringValue("PreviewSettings","DefaultCoverStorage")
- 'Coverstorage = 0 -> Save image to tag (if possible) otherwise save to file folder
- 'Coverstorage = 1 -> Save image to file folder
- 'Coverstorage = 2 -> Save image to cover folder (is deprecated and will not be supported !!)
- 'Coverstorage = 3 -> Save image to tag (if possible) and to file folder
- If CoverStorage = 2 Then
- Call SDB.MessageBox("Discogs Images: Your Cover Storage is not supported by DiscogsImages !",mtError,Array(mbOk))
- Exit Sub
- End If
- CoverStorageName = ini.StringValue("AAMasks","Mask1")
- '----------------------------------DiscogsImages----------------------------------------
- End If
- CheckAlbum = ini.BoolValue("DiscogsAutoTagWeb","CheckAlbum")
- CheckArtist = ini.BoolValue("DiscogsAutoTagWeb","CheckArtist")
- CheckAlbumArtist = ini.BoolValue("DiscogsAutoTagWeb","CheckAlbumArtist")
- CheckAlbumArtistFirst = ini.BoolValue("DiscogsAutoTagWeb","CheckAlbumArtistFirst")
- CheckLabel = ini.BoolValue("DiscogsAutoTagWeb","CheckLabel")
- CheckDate = ini.BoolValue("DiscogsAutoTagWeb","CheckDate")
- CheckOrigDate = ini.BoolValue("DiscogsAutoTagWeb","CheckOrigDate")
- CheckGenre = ini.BoolValue("DiscogsAutoTagWeb","CheckGenre")
- CheckStyle = ini.BoolValue("DiscogsAutoTagWeb","CheckStyle")
- CheckCountry = ini.BoolValue("DiscogsAutoTagWeb","CheckCountry")
- CheckSaveImage = ini.StringValue("DiscogsAutoTagWeb","CheckSaveImage")
- CheckSmallCover = ini.BoolValue("DiscogsAutoTagWeb","CheckSmallCover")
- CheckCatalog = ini.BoolValue("DiscogsAutoTagWeb","CheckCatalog")
- CheckRelease = ini.BoolValue("DiscogsAutoTagWeb","CheckRelease")
- CheckInvolved = ini.BoolValue("DiscogsAutoTagWeb","CheckInvolved")
- CheckGrouping = ini.BoolValue("DiscogsAutoTagWeb","CheckGrouping")
- CheckLyricist = ini.BoolValue("DiscogsAutoTagWeb","CheckLyricist")
- CheckComposer = ini.BoolValue("DiscogsAutoTagWeb","CheckComposer")
- CheckConductor = ini.BoolValue("DiscogsAutoTagWeb","CheckConductor")
- CheckProducer = ini.BoolValue("DiscogsAutoTagWeb","CheckProducer")
- CheckDiscNum = ini.BoolValue("DiscogsAutoTagWeb","CheckDiscNum")
- CheckTrackNum = ini.BoolValue("DiscogsAutoTagWeb","CheckTrackNum")
- CheckFormat = ini.BoolValue("DiscogsAutoTagWeb","CheckFormat")
- CheckUseAnv = ini.BoolValue("DiscogsAutoTagWeb","CheckUseAnv")
- CheckYearOnlyDate = ini.BoolValue("DiscogsAutoTagWeb","CheckYearOnlyDate")
- CheckForceNumeric = ini.BoolValue("DiscogsAutoTagWeb","CheckForceNumeric")
- CheckSidesToDisc = ini.BoolValue("DiscogsAutoTagWeb","CheckSidesToDisc")
- CheckForceDisc = ini.BoolValue("DiscogsAutoTagWeb","CheckForceDisc")
- CheckOriginalDiscogsTrack = ini.BoolValue("DiscogsAutoTagWeb","CheckOriginalDiscogsTrack")
- CheckNoDisc = ini.BoolValue("DiscogsAutoTagWeb","CheckNoDisc")
- REM CheckUserCollection = ini.BoolValue("DiscogsAutoTagWeb","CheckUserCollection")
- DiscogsUsername = ini.StringValue("DiscogsAutoTagWeb","DiscogsUsername")
- ReleaseTag = ini.StringValue("DiscogsAutoTagWeb","ReleaseTag")
- CatalogTag = ini.StringValue("DiscogsAutoTagWeb","CatalogTag")
- CountryTag = ini.StringValue("DiscogsAutoTagWeb","CountryTag")
- FormatTag = ini.StringValue("DiscogsAutoTagWeb","FormatTag")
- CheckLeadingZero = ini.BoolValue("DiscogsAutoTagWeb","CheckLeadingZero")
- CheckLeadingZeroDisc = ini.BoolValue("DiscogsAutoTagWeb","CheckLeadingZeroDisc")
- CheckVarious = ini.BoolValue("DiscogsAutoTagWeb","CheckVarious")
- TxtVarious = ini.StringValue("DiscogsAutoTagWeb","TxtVarious")
- CheckTitleFeaturing = ini.BoolValue("DiscogsAutoTagWeb","CheckTitleFeaturing")
- CheckFeaturingName = ini.boolValue("DiscogsAutoTagWeb","CheckFeaturingName")
- TxtFeaturingName = ini.StringValue("DiscogsAutoTagWeb","TxtFeaturingName")
- CheckComment = ini.BoolValue("DiscogsAutoTagWeb","CheckComment")
- SubTrackNameSelection = ini.BoolValue("DiscogsAutoTagWeb","SubTrackNameSelection")
- Separator = ini.StringValue("Appearance","MultiStringSeparator")
- tmpCountry = ini.StringValue("DiscogsAutoTagWeb","CurrentCountryFilter")
- tmpCountry2 = Split(tmpCountry, ",")
- If UBound(tmpCountry2) < 262 Then
- tmp = "0"
- For a = 1 To 263
- tmp = tmp & ",0"
- Next
- ini.StringValue("DiscogsAutoTagWeb","CurrentCountryFilter") = tmp
- tmpCountry2 = Split(tmp, ",")
- SDB.MessageBox "Country Filter was cleared", mtInformation, Array(mbOk)
- End If
- tmpMediaType = ini.StringValue("DiscogsAutoTagWeb","CurrentMediaTypeFilter")
- tmpMediaType2 = Split(tmpMediaType, ",")
- tmpMediaFormat = ini.StringValue("DiscogsAutoTagWeb","CurrentMediaFormatFilter")
- tmpMediaFormat2 = Split(tmpMediaFormat, ",")
- tmpYear = ini.StringValue("DiscogsAutoTagWeb","CurrentYearFilter")
- tmpYear2 = Split(tmpYear, ",")
- LyricistKeywords = ini.StringValue("DiscogsAutoTagWeb","LyricistKeywords")
- ConductorKeywords = ini.StringValue("DiscogsAutoTagWeb","ConductorKeywords")
- ProducerKeywords = ini.StringValue("DiscogsAutoTagWeb","ProducerKeywords")
- ComposerKeywords = ini.StringValue("DiscogsAutoTagWeb","ComposerKeywords")
- FeaturingKeywords = ini.StringValue("DiscogsAutoTagWeb","FeaturingKeywords")
- UnwantedKeywords = ini.StringValue("DiscogsAutoTagWeb","UnwantedKeywords")
- CheckStyleField = ini.StringValue("DiscogsAutoTagWeb","CheckStyleField")
- ArtistSeparator = ini.StringValue("DiscogsAutoTagWeb","ArtistSeparator")
- FormatSeparator = ini.StringValue("DiscogsAutoTagWeb","FormatSeparator")
- ArtistLastSeparator = ini.BoolValue("DiscogsAutoTagWeb","ArtistLastSeparator")
- CheckTurnOffSubTrack = ini.BoolValue("DiscogsAutoTagWeb","CheckTurnOffSubTrack")
- AccessToken = ini.StringValue("DiscogsAutoTagWeb","AccessToken")
- AccessTokenSecret = ini.StringValue("DiscogsAutoTagWeb","AccessTokenSecret")
- REM QueryPage = ini.StringValue("DiscogsAutoTagWeb","QueryPage")
- CheckInvolvedPeopleSingleLine = ini.BoolValue("DiscogsAutoTagWeb","CheckInvolvedPeopleSingleLine")
- CheckDontFillEmptyFields = ini.BoolValue("DiscogsAutoTagWeb","CheckDontFillEmptyFields")
- CheckNewVersion = ini.BoolValue("DiscogsAutoTagWeb","CheckNewVersion")
- LastCheck = ini.StringValue("DiscogsAutoTagWeb","LastCheck")
- CheckTheBehindArtist = ini.BoolValue("DiscogsAutoTagWeb","CheckTheBehindArtist")
- CheckDiscogsCollectionOff = ini.BoolValue("DiscogsAutoTagWeb","CheckDiscogsCollectionOff")
- CheckDeleteDuplicatedEntry = ini.BoolValue("DiscogsAutoTagWeb","CheckDeleteDuplicatedEntry")
- StoreDate = ini.StringValue("DiscogsAutoTagWeb","StoreDate")
- CheckLimitReleases = ini.StringValue("DiscogsAutoTagWeb","LimitReleases")
- CheckIgnoreFeatArtist = ini.BoolValue("DiscogsAutoTagWeb","CheckIgnoreFeatArtist")
- SubTrackSeparator = ini.StringValue("DiscogsAutoTagWeb","SubTrackSeparator")
- CheckReplaceAccentChar = ini.BoolValue("DiscogsAutoTagWeb","CheckReplaceAccentChar")
- CheckNewMatchingEngine = ini.BoolValue("DiscogsAutoTagWeb","CheckNewMatchingEngine")
- CheckShowQtyFormat = ini.BoolValue("DiscogsAutoTagWeb","CheckShowQtyFormat")
- Separator = Left(Separator, Len(Separator)-1)
- Separator = Right(Separator, Len(Separator)-1)
- CheckAlbumArtistFirst = False
- SelectAll = True
- Set MediaTypeList = SDB.NewStringList
- Set MediaFormatList = SDB.NewStringList
- Set CountryList = SDB.NewStringList
- Set CountryCode = SDB.NewStringList
- Set YearList = SDB.NewStringList
- Set AlternativeList = SDB.NewStringList
- Set LoadList = SDB.NewStringList
- Set RelationAttrList = SDB.NewStringList
- If CheckLimitReleases = 0 Then
- LimitReleases = 50
- ElseIf CheckLimitReleases = 1 Then
- LimitReleases = 100
- ElseIf CheckLimitReleases = 2 Then
- LimitReleases = 200
- ElseIf CheckLimitReleases = 3 Then
- LimitReleases = 400
- End If
- RelationAttrList.Add "Additional"
- RelationAttrList.Add "Assistant"
- RelationAttrList.Add "Associate"
- RelationAttrList.Add "Bonus"
- RelationAttrList.Add "Co"
- RelationAttrList.Add "Cover"
- RelationAttrList.Add "Executive"
- RelationAttrList.Add "Founder"
- RelationAttrList.Add "Guest"
- RelationAttrList.Add "Instrumental"
- RelationAttrList.Add "Live"
- RelationAttrList.Add "Medley"
- RelationAttrList.Add "Solo"
- LoadList.Add "Search Results"
- LoadList.Add "Master Release"
- LoadList.Add "Versions of Master"
- LoadList.Add "Releases of Artist"
- LoadList.Add "Releases of Label"
- MediaTypeList.Add "None"
- MediaTypeList.Add "Vinyl"
- MediaTypeList.Add "CD"
- MediaTypeList.Add "DVD"
- MediaTypeList.Add "Blu-Ray"
- MediaTypeList.Add "Cassette"
- MediaTypeList.Add "DAT"
- MediaTypeList.Add "Minidisc"
- MediaTypeList.Add "File"
- MediaTypeList.Add "Acetate"
- MediaTypeList.Add "Flexi-disc"
- MediaTypeList.Add "Lathe Cut"
- MediaTypeList.Add "Shellac"
- MediaTypeList.Add "Pathé Disc"
- MediaTypeList.Add "Edison Disc"
- MediaTypeList.Add "Cylinder"
- MediaTypeList.Add "CDr"
- MediaTypeList.Add "CDV"
- MediaTypeList.Add "DVDr"
- MediaTypeList.Add "HD DVD"
- MediaTypeList.Add "HD DVD-R"
- MediaTypeList.Add "Blue-ray-R"
- MediaTypeList.Add "4-Track Cartridge"
- MediaTypeList.Add "8-Track Cartridge"
- MediaTypeList.Add "DCC"
- MediaTypeList.Add "Microcassette"
- MediaTypeList.Add "Reel-To-Reel"
- MediaTypeList.Add "Betamax"
- MediaTypeList.Add "VHS"
- MediaTypeList.Add "Video 2000"
- MediaTypeList.Add "Laserdisc"
- MediaTypeList.Add "SelectaVision"
- MediaTypeList.Add "VHD"
- MediaTypeList.Add "MVD"
- MediaTypeList.Add "UMD"
- MediaTypeList.Add "Floppy Disk"
- MediaTypeList.Add "Memory Stick"
- MediaTypeList.Add "Hybrid"
- MediaTypeList.Add "Box Set"
- MediaFormatList.Add "None"
- MediaFormatList.Add "Album"
- MediaFormatList.Add "Mini-Album"
- MediaFormatList.Add "Compilation"
- MediaFormatList.Add "Single"
- MediaFormatList.Add "Maxi-Single"
- MediaFormatList.Add "7"""
- MediaFormatList.Add "12"""
- MediaFormatList.Add "LP"
- MediaFormatList.Add "EP"
- MediaFormatList.Add "Single Sided"
- MediaFormatList.Add "Enhanced"
- MediaFormatList.Add "Limited Edition"
- MediaFormatList.Add "Reissue"
- MediaFormatList.Add "Remastered"
- MediaFormatList.Add "Repress"
- MediaFormatList.Add "Test Pressing"
- MediaFormatList.Add "Unofficial"
- MediaFormatList.Add "Promo"
- MediaFormatList.Add "White Label"
- MediaFormatList.Add "Mixed"
- MediaFormatList.Add "Sampler"
- MediaFormatList.Add "MP3"
- MediaFormatList.Add "FLAC"
- MediaFormatList.Add "16"""
- MediaFormatList.Add "11"""
- MediaFormatList.Add "10"""
- MediaFormatList.Add "9"""
- MediaFormatList.Add "8"""
- MediaFormatList.Add "6"""
- MediaFormatList.Add "5"""
- MediaFormatList.Add "4"""
- MediaFormatList.Add "3"""
- MediaFormatList.Add "45 RPM"
- MediaFormatList.Add "78 RPM"
- MediaFormatList.Add "Shape"
- MediaFormatList.Add "Card Backed"
- MediaFormatList.Add "Etched"
- MediaFormatList.Add "Picture Disc"
- MediaFormatList.Add "Stereo"
- MediaFormatList.Add "Mono"
- MediaFormatList.Add "Quadraphonic"
- MediaFormatList.Add "Ambisonic"
- MediaFormatList.Add "Mispress"
- MediaFormatList.Add "Misprint"
- MediaFormatList.Add "Partially Mixed"
- MediaFormatList.Add "Unofficial Release"
- MediaFormatList.Add "Partially Unofficial"
- MediaFormatList.Add "Copy Protected"
- CountryList.Add "None"
- CountryList.Add "Australia"
- CountryList.Add "Belgium"
- CountryList.Add "Brazil"
- CountryList.Add "Canada"
- CountryList.Add "China"
- CountryList.Add "Cuba"
- CountryList.Add "France"
- CountryList.Add "Germany"
- CountryList.Add "Italy"
- CountryList.Add "Ireland"
- CountryList.Add "India"
- CountryList.Add "Jamaica"
- CountryList.Add "Japan"
- CountryList.Add "Mexico"
- CountryList.Add "Netherlands"
- CountryList.Add "New Zealand"
- CountryList.Add "Spain"
- CountryList.Add "Sweden"
- CountryList.Add "Switzerland"
- CountryList.Add "UK"
- CountryList.Add "US"
- CountryList.Add "=========="
- CountryList.Add "Worldwide"
- CountryList.Add "Africa"
- CountryList.Add "Asia"
- CountryList.Add "Australasia"
- CountryList.Add "Benelux"
- CountryList.Add "Central America"
- CountryList.Add "Europe"
- CountryList.Add "Gulf Cooperation Council"
- CountryList.Add "North America"
- CountryList.Add "Scandinavia"
- CountryList.Add "South America"
- CountryList.Add "==========="
- CountryList.Add "Afghanistan"
- CountryList.Add "Albania"
- CountryList.Add "Algeria"
- CountryList.Add "American Samoa"
- CountryList.Add "Andorra"
- CountryList.Add "Angola"
- CountryList.Add "Anguilla"
- CountryList.Add "Antarctica"
- CountryList.Add "Antigua and Barbuda"
- CountryList.Add "Argentina"
- CountryList.Add "Armenia"
- CountryList.Add "Aruba"
- CountryList.Add "Austria"
- CountryList.Add "Azerbaijan"
- CountryList.Add "Bahamas"
- CountryList.Add "Bahrain"
- CountryList.Add "Bangladesh"
- CountryList.Add "Barbados"
- CountryList.Add "Belarus"
- CountryList.Add "Belize"
- CountryList.Add "Benin"
- CountryList.Add "Bermuda"
- CountryList.Add "Bhutan"
- CountryList.Add "Bolivia, Plurinational State of"
- CountryList.Add "Bonaire, Sint Eustatius and Saba"
- CountryList.Add "Bosnia and Herzegovina"
- CountryList.Add "Botswana"
- CountryList.Add "Bouvet Island"
- CountryList.Add "British Indian Ocean Territory"
- CountryList.Add "Brunei Darussalam"
- CountryList.Add "Bulgaria"
- CountryList.Add "Burkina Faso"
- CountryList.Add "Burundi"
- CountryList.Add "Cabo Verde"
- CountryList.Add "Cambodia"
- CountryList.Add "Cameroon"
- CountryList.Add "Cayman Islands"
- CountryList.Add "Central African Republic"
- CountryList.Add "Chad"
- CountryList.Add "Chile"
- CountryList.Add "Christmas Island"
- CountryList.Add "Cocos (Keeling) Islands"
- CountryList.Add "Colombia"
- CountryList.Add "Comoros"
- CountryList.Add "Congo"
- CountryList.Add "Congo (the Democratic Republic of the)"
- CountryList.Add "Cook Islands"
- CountryList.Add "Costa Rica"
- CountryList.Add "Côte d'Ivoire"
- CountryList.Add "Croatia"
- CountryList.Add "Curaçao"
- CountryList.Add "Cyprus"
- CountryList.Add "Czech Republic"
- CountryList.Add "Czechoslovakia"
- CountryList.Add "Denmark"
- CountryList.Add "Djibouti"
- CountryList.Add "Dominica"
- CountryList.Add "Dominican Republic"
- CountryList.Add "Ecuador"
- CountryList.Add "Egypt"
- CountryList.Add "El Salvador"
- CountryList.Add "Equatorial Guinea"
- CountryList.Add "Eritrea"
- CountryList.Add "Estonia"
- CountryList.Add "Ethiopia"
- CountryList.Add "Falkland Islands [Malvinas]"
- CountryList.Add "Faroe Islands"
- CountryList.Add "Fiji"
- CountryList.Add "Finland"
- CountryList.Add "French Guiana"
- CountryList.Add "French Polynesia"
- CountryList.Add "French Southern Territories"
- CountryList.Add "Gabon"
- CountryList.Add "Gambia"
- CountryList.Add "Georgia"
- CountryList.Add "Ghana"
- CountryList.Add "Gibraltar"
- CountryList.Add "Greece"
- CountryList.Add "Greenland"
- CountryList.Add "Grenada"
- CountryList.Add "Guadeloupe"
- CountryList.Add "Guam"
- CountryList.Add "Guatemala"
- CountryList.Add "Guernsey"
- CountryList.Add "Guinea"
- CountryList.Add "Guinea-Bissau"
- CountryList.Add "Guyana"
- CountryList.Add "Haiti"
- CountryList.Add "Heard Island and McDonald Islands"
- CountryList.Add "Holy See [Vatican City State]"
- CountryList.Add "Honduras"
- CountryList.Add "Hong Kong"
- CountryList.Add "Hungary"
- CountryList.Add "Iceland"
- CountryList.Add "Indonesia"
- CountryList.Add "Iran (the Islamic Republic of)"
- CountryList.Add "Iraq"
- CountryList.Add "Isle of Man"
- CountryList.Add "Israel"
- CountryList.Add "Jersey"
- CountryList.Add "Jordan"
- CountryList.Add "Kazakhstan"
- CountryList.Add "Kenya"
- CountryList.Add "Kiribati"
- CountryList.Add "Korea (the Democratic People's Republic of)"
- CountryList.Add "Korea (the Republic of)"
- CountryList.Add "Kuwait"
- CountryList.Add "Kyrgyzstan"
- CountryList.Add "Lao People's Democratic Republic"
- CountryList.Add "Latvia"
- CountryList.Add "Lebanon"
- CountryList.Add "Lesotho"
- CountryList.Add "Liberia"
- CountryList.Add "Libya"
- CountryList.Add "Liechtenstein"
- CountryList.Add "Lithuania"
- CountryList.Add "Luxembourg"
- CountryList.Add "Macao"
- CountryList.Add "Macedonia (the former Yugoslav Republic of)"
- CountryList.Add "Madagascar"
- CountryList.Add "Malawi"
- CountryList.Add "Malaysia"
- CountryList.Add "Maldives"
- CountryList.Add "Mali"
- CountryList.Add "Malta"
- CountryList.Add "Marshall Islands"
- CountryList.Add "Martinique"
- CountryList.Add "Mauritania"
- CountryList.Add "Mauritius"
- CountryList.Add "Mayotte"
- CountryList.Add "Micronesia (the Federated States of)"
- CountryList.Add "Moldova (the Republic of)"
- CountryList.Add "Monaco"
- CountryList.Add "Mongolia"
- CountryList.Add "Montenegro"
- CountryList.Add "Montserrat"
- CountryList.Add "Morocco"
- CountryList.Add "Mozambique"
- CountryList.Add "Myanmar"
- CountryList.Add "Namibia"
- CountryList.Add "Nauru"
- CountryList.Add "Nepal"
- CountryList.Add "New Caledonia"
- CountryList.Add "Nicaragua"
- CountryList.Add "Niger"
- CountryList.Add "Nigeria"
- CountryList.Add "Niue"
- CountryList.Add "Norfolk Island"
- CountryList.Add "Northern Mariana Islands"
- CountryList.Add "Norway"
- CountryList.Add "Oman"
- CountryList.Add "Pakistan"
- CountryList.Add "Palau"
- CountryList.Add "Palestine, State of"
- CountryList.Add "Panama"
- CountryList.Add "Papua New Guinea"
- CountryList.Add "Paraguay"
- CountryList.Add "Peru"
- CountryList.Add "Philippines"
- CountryList.Add "Pitcairn"
- CountryList.Add "Poland"
- CountryList.Add "Portugal"
- CountryList.Add "Puerto Rico"
- CountryList.Add "Qatar"
- CountryList.Add "Réunion"
- CountryList.Add "Romania"
- CountryList.Add "Russian Federation"
- CountryList.Add "Rwanda"
- CountryList.Add "Saint Barthélemy"
- CountryList.Add "Saint Helena, Ascension and Tristan da Cunha"
- CountryList.Add "Saint Kitts and Nevis"
- CountryList.Add "Saint Lucia"
- CountryList.Add "Saint Martin (French part)"
- CountryList.Add "Saint Pierre and Miquelon"
- CountryList.Add "Saint Vincent and the Grenadines"
- CountryList.Add "Samoa"
- CountryList.Add "San Marino"
- CountryList.Add "Sao Tome and Principe"
- CountryList.Add "Saudi Arabia"
- CountryList.Add "Senegal"
- CountryList.Add "Serbia"
- CountryList.Add "Seychelles"
- CountryList.Add "Sierra Leone"
- CountryList.Add "Singapore"
- CountryList.Add "Sint Maarten (Dutch part)"
- CountryList.Add "Slovakia"
- CountryList.Add "Slovenia"
- CountryList.Add "Solomon Islands"
- CountryList.Add "Somalia"
- CountryList.Add "South Africa"
- CountryList.Add "South Georgia and the South Sandwich Islands"
- CountryList.Add "South Sudan "
- CountryList.Add "Sri Lanka"
- CountryList.Add "Sudan"
- CountryList.Add "Suriname"
- CountryList.Add "Svalbard and Jan Mayen"
- CountryList.Add "Swaziland"
- CountryList.Add "Syrian Arab Republic"
- CountryList.Add "Taiwan (Province of China)"
- CountryList.Add "Tajikistan"
- CountryList.Add "Tanzania, United Republic of"
- CountryList.Add "Thailand"
- CountryList.Add "Timor-Leste"
- CountryList.Add "Togo"
- CountryList.Add "Tokelau"
- CountryList.Add "Tonga"
- CountryList.Add "Trinidad and Tobago"
- CountryList.Add "Tunisia"
- CountryList.Add "Turkey"
- CountryList.Add "Turkmenistan"
- CountryList.Add "Turks and Caicos Islands"
- CountryList.Add "Tuvalu"
- CountryList.Add "Uganda"
- CountryList.Add "Ukraine"
- CountryList.Add "United Arab Emirates"
- CountryList.Add "United States Minor Outlying Islands"
- CountryList.Add "Uruguay"
- CountryList.Add "Uzbekistan"
- CountryList.Add "Vanuatu"
- CountryList.Add "Venezuela, Bolivarian Republic of "
- CountryList.Add "Viet Nam"
- CountryList.Add "Virgin Islands (British)"
- CountryList.Add "Virgin Islands (U.S.)"
- CountryList.Add "Wallis and Futuna"
- CountryList.Add "Western Sahara"
- CountryList.Add "Yemen"
- CountryList.Add "Zambia"
- CountryList.Add "Zimbabwe"
- CountryCode.Add ""
- CountryCode.Add "AU"
- CountryCode.Add "BE"
- CountryCode.Add "BR"
- CountryCode.Add "CA"
- CountryCode.Add "CN"
- CountryCode.Add "CU"
- CountryCode.Add "FR"
- CountryCode.Add "DE"
- CountryCode.Add "IT"
- CountryCode.Add "IE"
- CountryCode.Add "IN"
- CountryCode.Add "JM"
- CountryCode.Add "JP"
- CountryCode.Add "MX"
- CountryCode.Add "NL"
- CountryCode.Add "NZ"
- CountryCode.Add "ES"
- CountryCode.Add "SE"
- CountryCode.Add "CH"
- CountryCode.Add "GB"
- CountryCode.Add "US"
- CountryCode.Add ""
- CountryCode.Add "XW"
- CountryCode.Add ""
- CountryCode.Add ""
- CountryCode.Add ""
- CountryCode.Add ""
- CountryCode.Add ""
- CountryCode.Add "XE"
- CountryCode.Add ""
- CountryCode.Add ""
- CountryCode.Add ""
- CountryCode.Add ""
- CountryCode.Add ""
- CountryCode.Add "AF"
- CountryCode.Add "AL"
- CountryCode.Add "DZ"
- CountryCode.Add "AS"
- CountryCode.Add "AD"
- CountryCode.Add "AO"
- CountryCode.Add "AI"
- CountryCode.Add "AQ"
- CountryCode.Add "AG"
- CountryCode.Add "AR"
- CountryCode.Add "AM"
- CountryCode.Add "AW"
- CountryCode.Add "AT"
- CountryCode.Add "AZ"
- CountryCode.Add "BS"
- CountryCode.Add "BH"
- CountryCode.Add "BD"
- CountryCode.Add "BB"
- CountryCode.Add "BY"
- CountryCode.Add "BZ"
- CountryCode.Add "BJ"
- CountryCode.Add "BM"
- CountryCode.Add "BT"
- CountryCode.Add "BO"
- CountryCode.Add "BQ"
- CountryCode.Add "BA"
- CountryCode.Add "BW"
- CountryCode.Add "BV"
- CountryCode.Add "IO"
- CountryCode.Add "BN"
- CountryCode.Add "BG"
- CountryCode.Add "BF"
- CountryCode.Add "BI"
- CountryCode.Add "CV"
- CountryCode.Add "KH"
- CountryCode.Add "CM"
- CountryCode.Add "KY"
- CountryCode.Add "CF"
- CountryCode.Add "TD"
- CountryCode.Add "CL"
- CountryCode.Add "CX"
- CountryCode.Add "CC"
- CountryCode.Add "CO"
- CountryCode.Add "KM"
- CountryCode.Add "CG"
- CountryCode.Add "CD"
- CountryCode.Add "CK"
- CountryCode.Add "CR"
- CountryCode.Add "CI"
- CountryCode.Add "HR"
- CountryCode.Add "CW"
- CountryCode.Add "CY"
- CountryCode.Add "CZ"
- CountryCode.Add "XC"
- CountryCode.Add "DK"
- CountryCode.Add "DJ"
- CountryCode.Add "DM"
- CountryCode.Add "DO"
- CountryCode.Add "EC"
- CountryCode.Add "EG"
- CountryCode.Add "SV"
- CountryCode.Add "GQ"
- CountryCode.Add "ER"
- CountryCode.Add "EE"
- CountryCode.Add "ET"
- CountryCode.Add "FK"
- CountryCode.Add "FO"
- CountryCode.Add "FJ"
- CountryCode.Add "FI"
- CountryCode.Add "GF"
- CountryCode.Add "PF"
- CountryCode.Add "TF"
- CountryCode.Add "GA"
- CountryCode.Add "GM"
- CountryCode.Add "GE"
- CountryCode.Add "GH"
- CountryCode.Add "GI"
- CountryCode.Add "GR"
- CountryCode.Add "GL"
- CountryCode.Add "GD"
- CountryCode.Add "GP"
- CountryCode.Add "GU"
- CountryCode.Add "GT"
- CountryCode.Add "GG"
- CountryCode.Add "GN"
- CountryCode.Add "GW"
- CountryCode.Add "GY"
- CountryCode.Add "HT"
- CountryCode.Add "HM"
- CountryCode.Add "VA"
- CountryCode.Add "HN"
- CountryCode.Add "HK"
- CountryCode.Add "HU"
- CountryCode.Add "IS"
- CountryCode.Add "ID"
- CountryCode.Add "IR"
- CountryCode.Add "IQ"
- CountryCode.Add "IM"
- CountryCode.Add "IL"
- CountryCode.Add "JE"
- CountryCode.Add "JO"
- CountryCode.Add "KZ"
- CountryCode.Add "KE"
- CountryCode.Add "KI"
- CountryCode.Add "KP"
- CountryCode.Add "KR"
- CountryCode.Add "KW"
- CountryCode.Add "KG"
- CountryCode.Add "LA"
- CountryCode.Add "LV"
- CountryCode.Add "LB"
- CountryCode.Add "LS"
- CountryCode.Add "LR"
- CountryCode.Add "LY"
- CountryCode.Add "LI"
- CountryCode.Add "LT"
- CountryCode.Add "LU"
- CountryCode.Add "MO"
- CountryCode.Add "MK"
- CountryCode.Add "MG"
- CountryCode.Add "MW"
- CountryCode.Add "MY"
- CountryCode.Add "MV"
- CountryCode.Add "ML"
- CountryCode.Add "MT"
- CountryCode.Add "MH"
- CountryCode.Add "MQ"
- CountryCode.Add "MR"
- CountryCode.Add "MU"
- CountryCode.Add "YT"
- CountryCode.Add "FM"
- CountryCode.Add "MD"
- CountryCode.Add "MC"
- CountryCode.Add "MN"
- CountryCode.Add "ME"
- CountryCode.Add "MS"
- CountryCode.Add "MA"
- CountryCode.Add "MZ"
- CountryCode.Add "MM"
- CountryCode.Add "NA"
- CountryCode.Add "NR"
- CountryCode.Add "NP"
- CountryCode.Add "NC"
- CountryCode.Add "NI"
- CountryCode.Add "NE"
- CountryCode.Add "NG"
- CountryCode.Add "NU"
- CountryCode.Add "NF"
- CountryCode.Add "MP"
- CountryCode.Add "NO"
- CountryCode.Add "OM"
- CountryCode.Add "PK"
- CountryCode.Add "PW"
- CountryCode.Add "PS"
- CountryCode.Add "PA"
- CountryCode.Add "PG"
- CountryCode.Add "PY"
- CountryCode.Add "PE"
- CountryCode.Add "PH"
- CountryCode.Add "PN"
- CountryCode.Add "PL"
- CountryCode.Add "PT"
- CountryCode.Add "PR"
- CountryCode.Add "QA"
- CountryCode.Add "RE"
- CountryCode.Add "RO"
- CountryCode.Add "RU"
- CountryCode.Add "RW"
- CountryCode.Add "BL"
- CountryCode.Add "SH"
- CountryCode.Add "KN"
- CountryCode.Add "LC"
- CountryCode.Add "MF"
- CountryCode.Add "PM"
- CountryCode.Add "VC"
- CountryCode.Add "WS"
- CountryCode.Add "SM"
- CountryCode.Add "ST"
- CountryCode.Add "SA"
- CountryCode.Add "SN"
- CountryCode.Add "RS"
- CountryCode.Add "SC"
- CountryCode.Add "SL"
- CountryCode.Add "SG"
- CountryCode.Add "SX"
- CountryCode.Add "SK"
- CountryCode.Add "SI"
- CountryCode.Add "SB"
- CountryCode.Add "SO"
- CountryCode.Add "ZA"
- CountryCode.Add "GS"
- CountryCode.Add "SS"
- CountryCode.Add "LK"
- CountryCode.Add "SD"
- CountryCode.Add "SR"
- CountryCode.Add "SJ"
- CountryCode.Add "SZ"
- CountryCode.Add "SY"
- CountryCode.Add "TW"
- CountryCode.Add "TJ"
- CountryCode.Add "TZ"
- CountryCode.Add "TH"
- CountryCode.Add "TL"
- CountryCode.Add "TG"
- CountryCode.Add "TK"
- CountryCode.Add "TO"
- CountryCode.Add "TT"
- CountryCode.Add "TN"
- CountryCode.Add "TR"
- CountryCode.Add "TM"
- CountryCode.Add "TC"
- CountryCode.Add "TV"
- CountryCode.Add "UG"
- CountryCode.Add "UA"
- CountryCode.Add "AE"
- CountryCode.Add "UM"
- CountryCode.Add "UY"
- CountryCode.Add "UZ"
- CountryCode.Add "VU"
- CountryCode.Add "VE"
- CountryCode.Add "VN"
- CountryCode.Add "VG"
- CountryCode.Add "VI"
- CountryCode.Add "WF"
- CountryCode.Add "EH"
- CountryCode.Add "YE"
- CountryCode.Add "ZM"
- CountryCode.Add "ZW"
- YearList.Add "None"
- For i=Year(Date) To 1900 Step -1
- YearList.Add i
- Next
- If UBound(tmpYear2) <> YearList.Count -1 Then
- tmpYear = tmpYear & ",1"
- ini.StringValue("DiscogsAutoTagWeb","CurrentYearFilter") = tmpYear
- tmpYear2 = Split(tmpYear, ",")
- End If
- For a = 0 To CountryList.Count - 1
- CountryFilterList.Add tmpCountry2(a)
- Next
- For a = 0 To MediaTypeList.Count - 1
- MediaTypeFilterList.Add tmpMediaType2(a)
- Next
- For a = 0 To MediaFormatList.Count - 1
- MediaFormatFilterList.Add tmpMediaFormat2(a)
- Next
- For a = 0 To YearList.Count - 1
- YearFilterList.Add tmpYear2(a)
- Next
- For i = 0 to 999
- UnselectedTracks(i) = ""
- UnselectedTrackNames(i) = ""
- Next
- trackrefresh = True
- SearchTerm = Trim(SearchTerm)
- WriteLogInit
- WriteLog " "
- WriteLog "SearchTerm=" & SearchTerm
- WriteLog "SearchArtist=" & SearchArtist
- WriteLog "SearchAlbum=" & SearchAlbum
- WriteLog " "
- If SearchArtist <> "" And SearchAlbum <> "" Then
- tmp = SDB.Tools.WebSearch.NewTracks.Item(0).AlbumArtistName
- If tmp = "Various" or tmp = "Various Artists" or tmp = TxtVarious Then
- AddAlternative TxtVarious & " - " & SearchAlbum
- SearchTerm = "Various " & SearchAlbum
- SearchArtist = "Various"
- WriteLog "SearchTerm changed to: " & SearchTerm
- WriteLog "SearchArtist changed to: Various"
- Else
- AddAlternative SearchTerm
- AddAlternative SearchArtist
- AddAlternative SearchAlbum
- End If
- End If
- NewSearchTerm = SearchTerm
- For i = 0 To SDB.Tools.WebSearch.NewTracks.Count - 1
- AddAlternatives SDB.Tools.WebSearch.NewTracks.item(i)
- Next
- If MediaTypeFilterList.Item(0) = "0" Then
- FilterMediaType = "None"
- ElseIf MediaTypeFilterList.Item(0) = "1" Then
- FilterMediaType = "Use MediaType Filter"
- Else
- FilterMediaType = MediaTypeFilterList.Item(0)
- End If
- If MediaFormatFilterList.Item(0) = "0" Then
- FilterMediaFormat = "None"
- ElseIf MediaFormatFilterList.Item(0) = "1" Then
- FilterMediaFormat = "Use MediaFormat Filter"
- Else
- FilterMediaFormat = MediaFormatFilterList.Item(0)
- End If
- If CountryFilterList.Item(0) = "0" Then
- FilterCountry = "None"
- ElseIf CountryFilterList.Item(0) = "1" Then
- FilterCountry = "Use Country Filter"
- Else
- FilterCountry = CountryFilterList.Item(0)
- End If
- If YearFilterList.Item(0) = "0" Then
- FilterYear = "None"
- ElseIf YearFilterList.Item(0) = "1" Then
- FilterYear = "Use Year Filter"
- Else
- FilterYear = YearFilterList.Item(0)
- End If
- CurrentLoadType = "Search Results"
- If SDB.Tools.WebSearch.NewTracks.Count > 0 Then
- Set FirstTrack = SDB.Tools.WebSearch.NewTracks.item(0)
- SavedReleaseId = get_release_ID(FirstTrack) 'get saved Release_ID from User-Defined Custom-Tag
- SavedSearchArtist = SearchArtist
- SavedSearchAlbum = SearchAlbum
- NewSearchArtist = SearchArtist
- NewSearchAlbum = SearchAlbum
- End If
- UserAgent = "MediaMonkeyDiscogsAutoTagWeb/" & Mid(VersionStr, 2) & " +http://www.mediamonkey.com"
- If CheckNewVersion = True Then
- Dim iDate, Version, colNodes, objNode
- iDate = CDate(Now())
- If Int(LastCheck) <> Int(DatePart("d",iDate)) Then
- Dim xmlDoc
- Set xmlDoc = CreateObject("Microsoft.XMLDOM")
- xmlDoc.Async = "False"
- xmlDoc.Load("https://www.germanc64.de/mm/DiscogsAutoTagWeb.xml")
- Set colNodes = xmlDoc.selectNodes("//SoftwareVersion/VersionMajor")
- For Each objNode in colNodes
- Version = "v" & objNode.Text
- Next
- Set colNodes = xmlDoc.selectNodes("//SoftwareVersion/VersionMinor")
- For Each objNode in colNodes
- Version = Version & "." & objNode.Text
- Next
- Set colNodes = xmlDoc.selectNodes("//SoftwareVersion/VersionRelease")
- For Each objNode in colNodes
- Version = Version & objNode.Text
- Next
- ini.StringValue("DiscogsAutoTagWeb","LastCheck") = DatePart("d",iDate)
- If Version <> VersionStr Then
- SDB.MessageBox "A new version " & Version & " is released. Please download it via Tools->Extensions", mtInformation, Array(mbOk)
- End If
- End If
- End If
- Dim AlbumArt
- CheckCover = False
- SmallCover = False
- Set AlbumArt = FirstTrack.AlbumArt
- If CheckSaveImage = 0 Or CheckSaveImage = 1 Then
- If (AlbumArt.Count = 0 And CheckSaveImage = 1) Or CheckSaveImage = 0 Then
- If CheckSmallCover = True Then
- SmallCover = True
- End If
- CheckCover = True
- End If
- End If
- Dim itmAlbum
- For a = 0 To SDB.Tools.WebSearch.NewTracks.Count - 1
- Set tmp = SDB.Tools.WebSearch.NewTracks.item(a)
- Set itmAlbum = tmp.Album
- WriteLog "Disc=" & tmp.DiscNumberStr & " / Track=" & tmp.TrackOrderStr & " / AlbumID=" & itmAlbum.ID & " / Artist=" & tmp.ArtistName & " / Album=" & tmp.AlbumName & " / Title=" & tmp.Title
- If a = 0 Then NewSearchTrack = tmp.Title
- Next
- WriteLog " "
- ' This is a web browser that we use to present results to the user
- Set WebBrowser = UI.NewActiveX(Panel, "Shell.Explorer")
- WebBrowser.Common.Align = 5
- WebBrowser.Common.ControlName = "WebBrowser"
- WebBrowser.Common.Top = 0
- WebBrowser.Common.Left = 0
- SDB.Objects("WebBrowser") = WebBrowser
- WebBrowser.Interf.Visible = true
- WebBrowser.Common.BringToFront
- If QueryPage = "Discogs" Then
- ret = authorize_script(False)
- End If
- If ret = True Or QueryPage <> "Discogs" Then
- FindResults NewSearchTerm, QueryPage
- End If
- End Sub
- Sub FindResults(SearchTerm, QueryPage)
- SearchTerm = LTrim(SearchTerm)
- WriteLog "+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-"
- WriteLog "Start FindResults"
- WriteLog "SearchTerm=" & SearchTerm
- WriteLog "NewSearchArtist=" & NewSearchArtist
- WriteLog "NewSearchAlbum=" & NewSearchAlbum
- WriteLog "NewSearchTrack=" & NewSearchTrack
- Dim FilterFound, a, searchURL, searchURL_F, searchURL_L, SearchFor
- Dim SendArtist, SendAlbum, SendTrack, SendType, SendDBSearch, SendPerPage
- Set Results = SDB.NewStringList
- Set ResultsReleaseID = SDB.NewStringList
- ErrorMessage = ""
- SDB.Tools.WebSearch.ClearTracksData
- Set FirstTrack = SDB.Tools.WebSearch.NewTracks.item(0)
- If (InStr(SearchTerm," - [search by release id]") > 0) Then
- SearchTerm = Left(SearchTerm,InStrRev(SearchTerm," - [search by release id]")-1)
- End If
- If (InStr(SearchTerm," - [search by release url]") > 0) Then
- SearchTerm = Left(SearchTerm,InStrRev(SearchTerm," - [search by release url]")-1)
- End If
- If (InStr(SearchTerm," - [currently tagged with this release]") > 0) Then
- SearchTerm = Left(SearchTerm,InStrRev(SearchTerm," - [currently tagged with this release]")-1)
- End If
- If (InStr(SearchTerm," - [search returned no results]") > 0) Then
- SearchTerm = Left(SearchTerm,InStrRev(SearchTerm," - [search returned no results]")-1)
- End If
- If (InStr(SearchTerm," - [search that yielded error]") > 0) Then
- SearchTerm = Left(SearchTerm,InStrRev(SearchTerm," - [search that yielded error]")-1)
- End If
- ' Handle direct urls
- If (InStr(SearchTerm,"/master/") > 0) Then
- CurrentLoadType = "Master Release"
- LoadMasterResults Mid(SearchTerm,InStrRev(SearchTerm,"/")+1)
- Exit Sub
- End If
- If (InStr(SearchTerm,"/artist/") > 0) Then
- CurrentLoadType = "Releases of Artist"
- tmp = Mid(SearchTerm,InStrRev(SearchTerm,"/")+1)
- tmp = Left(tmp, InStr(tmp,"-")-1)
- LoadArtistResults tmp
- Exit Sub
- End If
- If (InStr(SearchTerm,"/label/") > 0) Then
- CurrentLoadType = "Releases of Label"
- tmp = Mid(SearchTerm,InStrRev(SearchTerm,"/")+1)
- tmp = Left(tmp, InStr(tmp,"-")-1)
- LoadLabelResults tmp
- Exit Sub
- End If
- If Left(SearchTerm, 2) = "[m" Then
- CurrentLoadType = "Master Release"
- LoadMasterResults Mid(SearchTerm, 3, Len(SearchTerm)-3)
- Exit Sub
- End If
- If Left(SearchTerm, 2) = "[a" Then
- CurrentLoadType = "Releases of Artist"
- LoadArtistResults Mid(SearchTerm, 3, Len(SearchTerm)-3)
- Exit Sub
- End If
- If Left(SearchTerm, 2) = "[l" Then
- CurrentLoadType = "Releases of Label"
- LoadLabelResults Mid(SearchTerm, 3, Len(SearchTerm)-3)
- Exit Sub
- End If
- If Left(SearchTerm, 2) = "[r" Then
- CurrentLoadType = "Search Results"
- SearchTerm = Mid(SearchTerm, 3, Len(SearchTerm)-3)
- End If
- SDB.ProcessMessages
- If SearchTerm = "" and NewSearchArtist = "" And NewSearchAlbum = "" And NewSearchTrack = "" Then
- ErrorMessage = "No search term"
- WriteLog "No search term"
- ElseIf IsNumeric(SearchTerm) Then
- Results.Add SearchTerm & " - [search by release id]"
- ResultsReleaseID.Add SearchTerm
- REM QueryPage = "Discogs"
- ElseIf Len(SearchTerm) = 36 And Mid(SearchTerm, 9, 1) = "-" And Mid(SearchTerm, 14, 1) = "-" Then
- Results.Add SearchTerm & " - [search by release id]"
- ResultsReleaseID.Add SearchTerm
- REM QueryPage = "MusicBrainz"
- '6c3d0635-4fac-4085-b85b-79b6a7b13c21
- ElseIf (InStr(SearchTerm,"/release/") > 0) Then
- Results.Add SearchTerm & " - [search by release url]"
- ResultsReleaseID.Add Mid(SearchTerm,InStrRev(SearchTerm,"/")+1)
- REM QueryPage = "Discogs"
- Else
- If QueryPage = "MetalArchives" Then
- 'searchURL = "http://www.metal-archives.com/search/ajax-advanced/searching/albums?bandName=" & URLEncodeUTF8(CleanSearchString(SavedSearchArtist)) & "&exactBandMatch=1&releaseTitle=" & URLEncodeUTF8(CleanSearchString(SavedSearchAlbum)) & "&exactReleaseMatch=1&releaseYearFrom=&releaseMonthFrom=&releaseYearTo=&releaseMonthTo=&country=&location=&releaseLabelName=&genre=#albums"
- searchURL = "https://www.metal-archives.com/search/ajax-advanced/searching/albums/?bandName=" & URLEncodeUTF8(CleanSearchString(NewSearchArtist)) & "&exactBandMatch=1&releaseTitle=" & URLEncodeUTF8(CleanSearchString(NewSearchAlbum)) & "&exactReleaseMatch=1&releaseYearFrom=&releaseMonthFrom=&releaseYearTo=&releaseMonthTo=&country=&location=&releaseLabelName=&genre="
- JSONParser_find_result searchURL, "", "", "", "", "", "", "", "MetalArchives", False
- End If
- If QueryPage = "Discogs" Then
- If IsNumeric(SavedReleaseId) Then
- Results.Add FirstTrack.AlbumArtistName & " - " & FirstTrack.Album.Name & " - [currently tagged with this release]"
- ResultsReleaseID.Add SavedReleaseId
- End If
- SendType = "release"
- SendPerPage = "100"
- If SearchTerm <> "" And NewSearchArtist = "" And NewSearchAlbum = "" Then
- REM Search from user-typed input
- WriteLog "Search from user-typed input"
- SendDBSearch = URLEncodeUTF8(CleanSearchString(SearchTerm))
- ElseIf NewSearchArtist <> "" Or NewSearchAlbum <> "" Or NewSearchTrack <> "" Then
- SendArtist = URLEncodeUTF8(CleanSearchString(NewSearchArtist))
- SendAlbum = URLEncodeUTF8(CleanSearchString(NewSearchAlbum))
- If SendAlbum = "" Then
- SendTrack = URLEncodeUTF8(CleanSearchString(NewSearchTrack))
- End If
- Else
- ErrorMessage = "No SearchTerm found"
- WriteLog "No SearchTerm found"
- End If
- If ErrorMessage = "" Then
- JSONParser_find_result "", "results", SendArtist, SendAlbum, SendTrack, SendType, SendDBSearch, SendPerPage, QueryPage, True
- End If
- End If
- If QueryPage = "MusicBrainz" Then
- If Len(SavedReleaseId) = 36 Then
- Results.Add FirstTrack.AlbumArtistName & " - " & FirstTrack.Album.Name & " - [currently tagged with this release]"
- ResultsReleaseID.Add SavedReleaseId
- End If
- WriteLog "searchTerm=" & SearchTerm
- WriteLog "newsearchTerm=" & NewSearchTerm
- If SearchTerm <> "" And NewSearchArtist = "" And NewSearchAlbum = "" Then
- REM Search from user-typed input
- WriteLog "Search from user-typed input"
- SearchFor = ShowSearchFor()
- If SearchFor = 1 Then
- searchURL = "http://musicbrainz.org/ws/2/release?query=artist:" & Chr(34) & CleanSearchString(URLEncodeUTF8(SearchTerm)) & Chr(34) & "&limit=50&offset=0&fmt=json"
- ElseIf SearchFor = 2 Then
- searchURL = "http://musicbrainz.org/ws/2/release?query=release:" & Chr(34) & CleanSearchString(URLEncodeUTF8(SearchTerm)) & Chr(34) & "&limit=50&offset=0&fmt=json"
- ElseIf SearchFor = 3 Then
- a = Split(SearchTerm, " - ")
- If UBound(a) = 1 Then
- searchURL = "http://musicbrainz.org/ws/2/release?query=artist:" & Chr(34) & CleanSearchString(URLEncodeUTF8(a(0))) & Chr(34) & " AND release:" & Chr(34) & URLEncodeUTF8(CleanSearchString(a(1))) & Chr(34) & "&limit=50&offset=0&fmt=json"
- Else
- SDB.MessageBox "Please use this format: Artist - Album", mtInformation, Array(mbOk)
- End If
- End If
- WriteLog "SearchFor= " & SearchFor
- ElseIf (NewSearchArtist <> "" And NewSearchAlbum = "") Or (SearchTerm <> "" And SearchTerm = NewSearchArtist) Then
- searchURL = "http://musicbrainz.org/ws/2/release?query=artist:" & Chr(34) & CleanSearchString(URLEncodeUTF8(NewSearchArtist)) & Chr(34) & "&limit=50&offset=0&fmt=json"
- ElseIf NewSearchArtist <> "" And NewSearchAlbum <> "" Then
- searchURL = "http://musicbrainz.org/ws/2/release?query=artist:" & Chr(34) & CleanSearchString(URLEncodeUTF8(NewSearchArtist)) & Chr(34) & " AND release:" & Chr(34) & URLEncodeUTF8(CleanSearchString(NewSearchAlbum)) & Chr(34) & "&limit=50&offset=0&fmt=json"
- ElseIf NewSearchArtist = "" And NewSearchAlbum <> "" Then
- searchURL = "http://musicbrainz.org/ws/2/release?query=release:" & Chr(34) & CleanSearchString(URLEncodeUTF8(NewSearchAlbum)) & Chr(34) & "&limit=50&offset=0&fmt=json"
- End If
- If searchURL <> "" Then
- WriteLog "searchURL=" & searchURL
- JSONParser_find_result searchURL, "releases", "", "", "", "", "", "", "MusicBrainz", False
- End If
- End If
- If ResultsReleaseID.Count = 0 And ErrorMessage = "" Then
- WriteLog "ResultsReleaseID=0"
- FilterFound = False
- If FilterCountry = "Use Country Filter" Then
- For a = 1 To CountryList.Count - 1
- If CountryFilterList.Item(a) = "1" Then
- FilterFound = True
- Exit For
- End If
- Next
- If FilterFound = False Then
- ErrorMessage = "No Country Filter set !"
- Else
- ErrorMessage = "Search returned no results"
- End If
- End If
- FilterFound = False
- If FilterMediaType = "Use MediaType Filter" Then
- For a = 1 To MediaTypeList.Count - 1
- If MediaTypeFilterList.Item(a) = "1" Then
- FilterFound = True
- Exit For
- End If
- Next
- If FilterFound = False Then
- If ErrorMessage = "" Then
- ErrorMessage = "No MediaType Filter set !"
- Else
- ErrorMessage = ErrorMessage & vbCrLf & "No MediaType Filter set !"
- End If
- End If
- End If
- FilterFound = False
- If FilterMediaFormat = "Use MediaFormat Filter" Then
- For a = 1 To MediaFormatList.Count - 1
- If MediaFormatFilterList.Item(a) = "1" Then
- FilterFound = True
- Exit For
- End If
- Next
- If FilterFound = False Then
- If ErrorMessage = "" Then
- ErrorMessage = "No MediaFormat Filter set !"
- Else
- ErrorMessage = ErrorMessage & vbCrLf & "No MediaFormat Filter set !"
- End If
- End If
- End If
- FilterFound = False
- If FilterYear = "Use Year Filter" Then
- For a = 1 To YearList.Count - 1
- If YearFilterList.Item(a) = "1" Then
- FilterFound = True
- Exit For
- End If
- Next
- If FilterFound = False Then
- If ErrorMessage = "" Then
- ErrorMessage = "No Year Filter set !"
- Else
- ErrorMessage = ErrorMessage & vbCrLf & "No Year Filter set !"
- End If
- End If
- End If
- If ErrorMessage = "" Then
- ErrorMessage = "Search returned no results"
- End If
- Results.Add SearchTerm & " - [search returned no results]"
- ResultsReleaseID.Add ""
- End If
- End If
- SDB.ProcessMessages
- SDB.Tools.WebSearch.SetSearchResults Results
- SDB.Tools.WebSearch.ResultIndex = 0
- If ErrorMessage <> "" Then
- FormatErrorMessage ErrorMessage
- End If
- End Sub
- Sub LoadMasterResults(MasterID)
- Dim searchURL
- Dim oXMLHTTP
- Dim json
- Set json = New VbsJson
- Dim title, v_year, artist, artistName, main_release, ReleaseDesc, currentArtist, AlbumArtistTitle, tmp
- WriteLog " "
- WriteLog "+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+"
- Set oXMLHTTP = CreateObject("MSXML2.XMLHTTP.6.0")
- WriteLog "Load MasterResult"
- ErrorMessage = ""
- If MasterID = "" Then
- ErrorMessage = "Cannot load empty master release"
- Else
- If QueryPage = "MusicBrainz" Then
- ErrorMessage = "Cannot load master release from MusicBrainz"
- ElseIf QueryPage = "Discogs" Then
- searchURL = "https://api.discogs.com/masters/" & MasterID
- WriteLog "searchURL=" & searchURL
- Set oXMLHTTP = CreateObject("MSXML2.XMLHTTP.6.0")
- oXMLHTTP.open "GET", searchURL, false
- oXMLHTTP.setRequestHeader "Content-Type","application/json"
- oXMLHTTP.setRequestHeader "User-Agent",UserAgent
- oXMLHTTP.send()
- If oXMLHTTP.Status = 200 Then
- WriteLog "responseText=" & oXMLHTTP.responseText
- If InStr(oXMLHTTP.responseText, "OAuth client error") <> 0 Then
- ErrorMessage = oXMLHTTP.responseText
- Else
- Set currentRelease = json.Decode(oXMLHTTP.responseText)
- Set Results = SDB.NewStringList
- Set ResultsReleaseID = SDB.NewStringList
- title = ""
- v_year = ""
- artist = ""
- main_release = ""
- SDB.ProcessMessages
- title = CurrentRelease("title")
- tmp = getArtistsName(CurrentRelease, "artists", QueryPage)
- AlbumArtistTitle = tmp(0)
- If CurrentRelease.Exists("main_release") Then
- main_release = CurrentRelease("main_release")
- End If
- If CurrentRelease.Exists("year") Then
- v_year = CurrentRelease("year")
- End If
- If AlbumArtistTitle <> "" Then ReleaseDesc = AlbumArtistTitle End If
- If AlbumArtistTitle <> "" and title <> "" Then ReleaseDesc = ReleaseDesc & " -" End If
- If title <> "" Then ReleaseDesc = ReleaseDesc & " " & title End If
- If v_year <> "" Then ReleaseDesc = ReleaseDesc & " (" & v_year & ")" End If
- ReleaseDesc = ReleaseDesc & " (Master)"
- Results.Add ReleaseDesc
- ResultsReleaseID.Add CurrentRelease("id")
- SDB.Tools.WebSearch.SetSearchResults Results
- SDB.Tools.WebSearch.ResultIndex = 0
- ReloadResults
- End If
- Else
- ErrorMessage = "Try loading Master returns ErrorCode: " & oXMLHTTP.Status
- WriteLog "Try loading Master returns ErrorCode: " & oXMLHTTP.Status
- End If
- End If
- End If
- If ErrorMessage <> "" Then
- FormatErrorMessage ErrorMessage
- End If
- End Sub
- Sub LoadVersionResults(MasterID)
- WriteLog "VersionResult"
- Set Results = SDB.NewStringList
- Set ResultsReleaseID = SDB.NewStringList
- ErrorMessage = ""
- If MasterID = "" Then
- ErrorMessage = "Cannot load empty master release"
- Else
- If IsNumeric(SavedReleaseId) Then
- Set FirstTrack = SDB.Tools.WebSearch.NewTracks.item(0)
- Results.Add FirstTrack.AlbumArtistName & " - " & FirstTrack.Album.Name & " - [currently tagged with this release]"
- ResultsReleaseID.Add SavedReleaseId
- End If
- If QueryPage = "Discogs" Then
- JSONParser_find_result "https://api.discogs.com/masters/" & MasterID & "/versions?per_page=100", "versions", "", "", "", "", "", "", "Discogs", False
- Else
- ErrorMessage = "Cannot load master release from MusicBrainz"
- End If
- End If
- SDB.Tools.WebSearch.SetSearchResults Results
- SDB.Tools.WebSearch.ResultIndex = 0
- If ErrorMessage <> "" Then
- FormatErrorMessage ErrorMessage
- End If
- End Sub
- Sub LoadArtistResults(ArtistId)
- Set Results = SDB.NewStringList
- Set ResultsReleaseID = SDB.NewStringList
- ErrorMessage = ""
- If ArtistId = "" Then
- ErrorMessage = "Cannot load empty artist"
- Else
- If IsNumeric(SavedReleaseId) Then
- Set FirstTrack = SDB.Tools.WebSearch.NewTracks.item(0)
- Results.Add FirstTrack.AlbumArtistName & " - " & FirstTrack.Album.Name & " - [currently tagged with this release]"
- ResultsReleaseID.Add SavedReleaseId
- End If
- If QueryPage = "Discogs" Then
- JSONParser_find_result "https://api.discogs.com/artists/" & ArtistId & "/releases?per_page=100", "releases", "", "", "", "", "", "", "Discogs", False
- ElseIf QueryPage = "MusicBrainz" Then
- JSONParser_find_result "http://musicbrainz.org/ws/2/release?artist=" & ArtistId & "&inc=artist-credits+release-groups+media&fmt=json&limit=100", "Artist", "", "", "", "", "", "", "MusicBrainz", False
- End If
- End If
- SDB.Tools.WebSearch.SetSearchResults Results
- SDB.Tools.WebSearch.ResultIndex = 0
- If ErrorMessage <> "" Then
- FormatErrorMessage ErrorMessage
- End If
- End Sub
- Sub LoadLabelResults(LabelId)
- Set Results = SDB.NewStringList
- Set ResultsReleaseID = SDB.NewStringList
- ErrorMessage = ""
- If LabelId = "" Then
- ErrorMessage = "Cannot load empty label"
- Else
- If IsNumeric(SavedReleaseId) Then
- Set FirstTrack = SDB.Tools.WebSearch.NewTracks.item(0)
- Results.Add FirstTrack.AlbumArtistName & " - " & FirstTrack.Album.Name & " - [currently tagged with this release]"
- ResultsReleaseID.Add SavedReleaseId
- End If
- If QueryPage = "Discogs" Then
- JSONParser_find_result "https://api.discogs.com/labels/" & LabelId & "/releases?per_page=100", "releases", "", "", "", "", "", "", "Discogs", False
- ElseIf QueryPage = "MusicBrainz" Then
- JSONParser_find_result "http://musicbrainz.org/ws/2/release?label=" & LabelId & "&inc=artist-credits+media&fmt=json&limit=100", "Label", "", "", "", "", "", "", "MusicBrainz", False
- End If
- End If
- SDB.Tools.WebSearch.SetSearchResults Results
- SDB.Tools.WebSearch.ResultIndex = 0
- If ErrorMessage <> "" Then
- FormatErrorMessage ErrorMessage
- End If
- End Sub
- 'For reloading results
- Sub ReloadResults
- Dim Tracks, TracksNum, DiscogsTracksNum, TracksCD, ArtistTitles, InvolvedArtists, Lyricists, Composers, Conductors, Producers, Durations
- Dim AlbumArtist, AlbumArtistTitle, AlbumLyricist, AlbumComposer, AlbumConductor, AlbumProducer, AlbumInvolved, AlbumFeaturing, AlbumTitle
- Dim track, currentTrack, position, artist, currentArtist, artistName, extraArtist, extra
- Dim currentImage, currentLabel, currentFormat, theMaster, i, g, l, s, f, d, currentMedia, m, t, x
- Dim ReleaseDate, ReleaseSplit, theLabels, theCatalogs, theCountry, theFormat
- Dim rTrackPosition, rSubPosition
- Dim oXMLHTTP, searchURL
- Dim tmpArt, image
- Dim Genres, Styles, Comment, DataQuality
- Dim NoSubTrackUsing, oldSubTrackNumber
- Set Tracks = SDB.NewStringList
- Set TracksNum = SDB.NewStringList
- Set DiscogsTracksNum = SDB.NewStringList
- Set TracksCD = SDB.NewStringList
- Set ArtistTitles = SDB.NewStringList
- Set InvolvedArtists = SDB.NewStringList
- Set Lyricists = SDB.NewStringList
- Set Composers = SDB.NewStringList
- Set Conductors = SDB.NewStringList
- Set Producers = SDB.NewStringList
- Set Durations = SDB.NewStringList
- Set rTrackPosition = SDB.NewStringList
- Set rSubPosition = SDB.NewStringList
- Set GenresList = SDB.NewStringList
- REM Set GenresSelect = SDB.NewStringList
- '----------------------------------DiscogsImages----------------------------------------
- Set SaveImage = SDB.NewStringList
- Set SaveImageType = SDB.NewStringList
- Set FileNameList = SDB.NewStringList
- ImagesCount = 0
- '----------------------------------DiscogsImages----------------------------------------
- If OptionsChanged = True Then
- OptionsChanged = False
- WriteOptions()
- End If
- If not isnull(CurrentRelease) Then
- AlbumArtist = ""
- AlbumArtistTitle = ""
- AlbumLyricist = ""
- AlbumComposer = ""
- AlbumConductor = ""
- AlbumProducer = ""
- AlbumInvolved = ""
- AlbumArtURL = ""
- AlbumArtThumbNail = ""
- AlbumFeaturing = ""
- LastDisc = ""
- Dim iTrackNum, cSubTrack, subTrackTitle, aSubtrack
- Dim trackName, pos
- Dim role, role2, rolea, currentRole, NoSplit, zahl, zahltemp, zahl2, zahltemp2
- Dim CharSeparatorSubTrack
- ReDim Involved_R(0)
- Dim tmp, tmp2, tmp3, tmp4, tmp5, tmpResponse
- Dim rTrack
- Dim ret, ResponseHTML, TXTBegin, TXTEnd, Title
- Dim LeadingZeroTrackPosition
- Dim FormatCnt
- ReDim TrackRoles(0)
- ReDim TrackArtist2(0)
- ReDim TrackPos(0)
- ReDim Title_Position(0)
- ReDim TitleList(0)
- ReDim ArtistsList(0)
- ReDim Grouping(0)
- SavedArtistID = ""
- SavedLabelID = ""
- LeadingZeroTrackPosition = False
- Dim involvedArtist, involvedTemp, involvedRole, subTrack
- Dim TrackInvolvedPeople, TrackComposers, TrackConductors, TrackProducers, TrackLyricists, TrackFeaturing, currentHeading, currentCD
- Dim TrackArtist, artistList, min, sec, length
- WriteLog "Start ReloadResults"
- WriteLog "QueryPage=" & QueryPage
- SDB.Tools.WebSearch.ClearTracksData
- ' +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- If QueryPage = "MetalArchives" Then
- ResponseHTML = CurrentRelease
- ' Get Album art URL
- TXTBegin = InStr(ResponseHTML, "album_img")
- ResponseHTML = Mid(ResponseHTML, TXTBegin)
- TXTBegin = InStr(ResponseHTML, "href=")
- ResponseHTML = Mid(ResponseHTML, TXTBegin + 6)
- TXTEnd = InStr(ResponseHTML, Chr(34) & "><")
- AlbumArtURL = Left(ResponseHTML, TXTEnd - 1)
- AlbumArtThumbNail = Left(ResponseHTML, TXTEnd - 1)
- If AlbumArtThumbNail <> "" Then
- ret = getimages(AlbumArtThumbNail, sTemp & "cover.jpg")
- AlbumArtThumbNail = sTemp & "cover.jpg"
- End If
- ' Get album title
- TXTBegin = InStr(ResponseHTML, "album_name")
- ResponseHTML = Mid(ResponseHTML, TXTBegin + 14)
- TXTBegin = InStr(ResponseHTML, Chr(34) & ">")
- ResponseHTML = Mid(ResponseHTML, TXTBegin + 2)
- TXTEnd = InStr(ResponseHTML, "</a>")
- AlbumTitle = PackSpaces(Left(ResponseHTML, TXTEnd - 1), False)
- WriteLog "AlbumTitle=" & AlbumTitle
- ' Get artist title
- TXTBegin = InStr(ResponseHTML, "<a href")
- ResponseHTML = Mid(ResponseHTML, TXTBegin)
- TXTBegin = InStr(ResponseHTML, Chr(34) & ">")
- ResponseHTML = Mid(ResponseHTML, TXTBegin + 2)
- TXTEnd = InStr(ResponseHTML, "</a>")
- AlbumArtist = Left(ResponseHTML, TXTEnd - 1)
- AlbumArtistTitle = AlbumArtist
- If (Not CheckAlbumArtistFirst) Then
- AlbumArtist = AlbumArtistTitle
- End If
- If AlbumArtist = "Various" And CheckVarious Then
- AlbumArtist = TxtVarious
- End If
- If AlbumArtistTitle = "Various" And CheckVarious Then
- AlbumArtistTitle = TxtVarious
- End If
- Writelog "AlbumArtist=" & AlbumArtist
- Writelog "AlbumArtistTitle=" & AlbumArtistTitle
- ' Get release year/date
- TXTBegin = InStr(ResponseHTML, "Release date:")
- ResponseHTML = Mid(ResponseHTML, TXTBegin)
- TXTBegin = InStr(ResponseHTML, "<dd>")
- ResponseHTML = Mid(ResponseHTML, TXTBegin + 4)
- TXTEnd = InStr(ResponseHTML, "</dd>")
- ReleaseDate = Left(ResponseHTML, TXTEnd -1)
- If Len(ReleaseDate) > 4 Then
- If CheckYearOnlyDate Then
- ReleaseDate = Right(ReleaseDate, 4)
- End If
- End If
- WriteLog "ReleaseDate=" & ReleaseDate
- 'Get catalog nr.
- TXTBegin = InStr(ResponseHTML, "Catalog ID:")
- ResponseHTML = Mid(ResponseHTML, TXTBegin)
- TXTBegin = InStr(ResponseHTML, "<dd>")
- ResponseHTML = Mid(ResponseHTML, TXTBegin + 4)
- TXTEnd = InStr(ResponseHTML, "</dd>")
- theCatalogs = Left(ResponseHTML, TXTEnd -1)
- WriteLog "theCatalogs=" & theCatalogs
- 'Get label
- TXTBegin = InStr(ResponseHTML, "Label:")
- ResponseHTML = Mid(ResponseHTML, TXTBegin)
- TXTBegin = InStr(ResponseHTML, Chr(34) & ">")
- ResponseHTML = Mid(ResponseHTML, TXTBegin + 2)
- TXTEnd = InStr(ResponseHTML, "</a>")
- theLabels = Left(ResponseHTML, TXTEnd -1)
- WriteLog "theLabels=" & theLabels
- 'Get format
- TXTBegin = InStr(ResponseHTML, "Format:")
- ResponseHTML = Mid(ResponseHTML, TXTBegin)
- TXTBegin = InStr(ResponseHTML, "<dd>")
- ResponseHTML = Mid(ResponseHTML, TXTBegin + 4)
- TXTEnd = InStr(ResponseHTML, "</dd>")
- theFormat = Left(ResponseHTML, TXTEnd -1)
- WriteLog "theFormat=" & theFormat
- TXTBegin = InStr(ResponseHTML, "tbody")
- TXTEnd = InStr(ResponseHTML, "/tbody")
- ResponseHTML = Mid(ResponseHTML, TXTBegin, TXTEnd - TXTBegin - 1)
- currentHeading = ""
- currentCD = ""
- iTrackNum = 0
- iAutoTrackNumber = 1
- iAutoDiscNumber = 1
- If CheckForceDisc = True Then
- If currentCD = "" Then currentCD = iAutoDiscNumber
- End If
- If CheckNoDisc = True Then
- If currentCD <> "" Then currentCD = ""
- End If
- WriteLog "currentCD=" & currentCD
- Do While InStr(ResponseHTML, "wrapWords") > 0
- If InStr(ResponseHTML, "<tr class=" & Chr(34) & "discRow" & Chr(34) & ">") < InStr(ResponseHTML, "class=" & Chr(34) & "anchor" & Chr(34) & ">") And InStr(ResponseHTML, "<tr class=" & Chr(34) & "discRow" & Chr(34) & ">") <> 0 Then
- WriteLog "Neue CD erkannt"
- TXTBegin = InStr(ResponseHTML, "<tr class=" & Chr(34) & "discRow" & Chr(34) & ">")
- tmpResponse = Mid(ResponseHTML, TXTBegin + 22)
- TXTBegin = InStr(tmpResponse, ">")
- TXTEnd = InStr(tmpResponse, "<")
- tmpResponse = Mid(tmpResponse, TXTBegin + 2, TXTEnd - TXTBegin - 2)
- tmp = Split(tmpResponse, Chr(10))
- If Ubound(tmp) = 2 Then
- currentHeading = PackSpaces(Mid(tmp(2), 3), False)
- currentCD = tmp(1)
- End If
- If Ubound(tmp) = 1 Then
- currentCD = tmp(1)
- End If
- iAutoTrackNumber = 1
- iAutoDiscNumber = iAutoDiscNumber + 1
- If CheckForceDisc = True Then
- If currentCD = "" Then currentCD = iAutoDiscNumber
- End If
- If CheckNoDisc = True Then
- If currentCD <> "" Then currentCD = ""
- End If
- End If
- ' TXTBegin = InStr(ResponseHTML, "<td class=" & Chr(34) & "wrapWords")
- TXTBegin = InStr(ResponseHTML, "class=" & Chr(34) & "anchor" & Chr(34) & ">")
- If TXTBegin = 0 Then Exit Do
- ResponseHTML = Mid(ResponseHTML, TXTBegin + 14)
- TXTBegin = InStr(ResponseHTML, "</a>")
- If TXTBegin = 0 Then Exit Do
- ResponseHTML = Mid(ResponseHTML, TXTBegin + 4)
- TXTEnd = InStr(ResponseHTML, "</td>")
- position = Left(ResponseHTML, TXTEnd -2)
- Title_Position(UBound(Title_Position)) = position
- ReDim Preserve Title_Position(UBound(Title_Position)+1)
- DiscogsTracksNum.Add position
- WriteLog "position=" & position
- TXTBegin = InStr(ResponseHTML, Chr(34) & ">")
- ResponseHTML = Mid(ResponseHTML, TXTBegin + 2)
- TXTEnd = InStr(ResponseHTML, "</td>")
- Title = Left(ResponseHTML, TXTEnd - 1)
- Title = Replace(Title, Chr(10), "")
- Title = Trim(Replace(Title, Chr(9), " "))
- WriteLog "Title=" & Title & chr(34)
- TitleList(UBound(TitleList)) = Title
- Tracks.Add Title
- ReDim Preserve TitleList(UBound(TitleList)+1)
- TXTBegin = InStr(ResponseHTML, "<td align=" & Chr(34) & "right" & Chr(34) & ">")
- ResponseHTML = Mid(ResponseHTML, TXTBegin + 18)
- TXTEnd = InStr(ResponseHTML, "</td>")
- Durations.Add Left(ResponseHTML, TXTEnd - 1)
- WriteLog "Duration=" & Left(ResponseHTML, TXTEnd - 1)
- ArtistsList(UBound(ArtistsList)) = AlbumArtist
- ReDim Preserve ArtistsList(UBound(ArtistsList)+1)
- ArtistTitles.Add AlbumArtist
- If UnselectedTracks(iTrackNum) <> "x" Then
- If CheckLeadingZero = True And iAutoTrackNumber < 10 Then
- tracksNum.Add "0" & iAutoTrackNumber
- tracksCD.Add LeadingZeroDisc(currentCD)
- WriteLog "Tracknumber=0" & iAutoTrackNumber
- WriteLog "currentCD=" & currentCD
- Else
- tracksNum.Add iAutoTrackNumber
- tracksCD.Add LeadingZeroDisc(currentCD)
- WriteLog "Tracknumber=" & iAutoTrackNumber
- WriteLog "currentCD=" & currentCD
- End If
- iAutoTrackNumber = iAutoTrackNumber + 1
- Lyricists.Add ""
- Composers.Add ""
- Conductors.Add ""
- Producers.Add ""
- InvolvedArtists.Add ""
- Grouping(UBound(Grouping)) = currentHeading
- ReDim Preserve Grouping(UBound(Grouping)+1)
- WriteLog "Grouping=" & currentHeading
- Else
- tracksNum.Add ""
- tracksCD.Add ""
- WriteLog "Tracknumber=Nothing"
- End If
- iTrackNum = iTrackNum + 1
- Loop
- ' Get Comment
- ' album_notes
- ' If CurrentRelease.Exists("notes") Then
- ' Comment = CurrentRelease("notes")
- ' Else
- ' Comment = ""
- ' End If
- ' WriteLog "Comment=" & Comment
- End If
- If QueryPage = "Discogs" Then
- 'Get Track-List
- For Each track In CurrentRelease("tracklist")
- 'track start at 0
- Set currentTrack = CurrentRelease("tracklist")(track)
- position = currentTrack("position")
- DiscogsTracksNum.Add position
- position = exchange_roman_numbers(position)
- Title_Position(UBound(Title_Position)) = position
- ReDim Preserve Title_Position(UBound(Title_Position)+1)
- TitleList(UBound(TitleList)) = currentTrack("title")
- ReDim Preserve TitleList(UBound(TitleList)+1)
- tmp = getArtistsName(currentTrack, "artists", QueryPage)
- ArtistsList(UBound(ArtistsList)) = tmp(0)
- ReDim Preserve ArtistsList(UBound(ArtistsList)+1)
- WriteLog "Track=" & track
- rTrackPosition.Add track
- If currentTrack("type_") = "heading" Then
- WriteLog "Heading Track found"
- currentHeading = PackSpaces(DecodeHtmlChars(currentTrack("title")), False)
- Grouping(UBound(Grouping)) = "|Heading|"
- ReDim Preserve Grouping(UBound(Grouping)+1)
- Else
- If currentHeading <> "" Then
- Grouping(UBound(Grouping)) = currentHeading
- ReDim Preserve Grouping(UBound(Grouping)+1)
- Else
- Grouping(UBound(Grouping)) = ""
- ReDim Preserve Grouping(UBound(Grouping)+1)
- End If
- End If
- If currentTrack.Exists("sub_tracks") Then
- WriteLog "SubTrack(s) found"
- rSubPosition.Add "NewSubTrack"
- For Each subtrack in currentTrack("sub_tracks")
- WriteLog "subTrack=" & subTrack
- Set aSubtrack = currentTrack("sub_tracks")(subtrack)
- position = aSubtrack("position")
- DiscogsTracksNum.Add position
- position = exchange_roman_numbers(position)
- Title_Position(UBound(Title_Position)) = position
- ReDim Preserve Title_Position(UBound(Title_Position)+1)
- rTrackPosition.Add track
- rSubPosition.Add subtrack
- TitleList(UBound(TitleList)) = aSubtrack("title")
- ReDim Preserve TitleList(UBound(TitleList)+1)
- tmp = getArtistsName(aSubtrack, "artists", QueryPage)
- ArtistsList(UBound(ArtistsList)) = tmp(0)
- ReDim Preserve ArtistsList(UBound(ArtistsList)+1)
- If aSubtrack("type_") = "heading" Then
- WriteLog "Heading SubTrack found"
- currentHeading = PackSpaces(DecodeHtmlChars(aSubtrack("title")), False)
- Grouping(UBound(Grouping)) = currentHeading
- ReDim Preserve Grouping(UBound(Grouping)+1)
- Else
- If currentHeading <> "" Then
- Grouping(UBound(Grouping)) = currentHeading
- ReDim Preserve Grouping(UBound(Grouping)+1)
- Else
- Grouping(UBound(Grouping)) = ""
- ReDim Preserve Grouping(UBound(Grouping)+1)
- End If
- End If
- Next
- Else
- rSubPosition.Add ""
- End If
- SDB.ProcessMessages
- Next
- WriteLog "rTrackPosition.Count=" & rTrackPosition.Count
- For i = 0 To UBound(TitleList)-1
- WriteLog i & " " & ArtistsList(i) & " - " & TitleList(i)
- Next
- REM For i = 0 To rSubPosition.count-1
- REM WriteLog i & " " & rSubPosition.item(i)
- REM Next
- 'Check for leading zero in track-position
- For i = 0 to UBound(Title_Position)-1
- If Title_Position(i) <> "" Then
- LeadingZeroTrackPosition = CheckLeadingZeroTrackPosition(Title_Position(i))
- Exit For
- End If
- Next
- WriteLog "LeadingZeroTrackPosition = " & LeadingZeroTrackPosition
- ' Get artist title
- tmp = getArtistsName(CurrentRelease, "artists", QueryPage)
- AlbumArtist = tmp(2)
- If tmp(1) <> "" Then
- AlbumArtistTitle = tmp(0) & " " & tmp(1)
- Else
- AlbumArtistTitle = tmp(0)
- End If
- Writelog "AlbumArtistTitle=" & AlbumArtistTitle
- If (Not CheckAlbumArtistFirst) Then
- AlbumArtist = AlbumArtistTitle
- End If
- If AlbumArtist = "Various" And CheckVarious Then
- AlbumArtist = TxtVarious
- End If
- If AlbumArtistTitle = "Various" And CheckVarious Then
- AlbumArtistTitle = TxtVarious
- End If
- If CurrentRelease.Exists("format_quantity") Then
- FormatCnt = CurrentRelease("format_quantity")
- Else
- FormatCnt = 0
- End If
- WriteLog " "
- WriteLog "ExtraArtists"
- If currentRelease.Exists("extraartists") Then
- For Each extraArtist In CurrentRelease("extraartists")
- WriteLog " "
- Set currentArtist = CurrentRelease("extraartists")(extraArtist)
- If currentArtist("tracks") = "" Then
- If (currentArtist("anv") <> "") And Not CheckUseAnv Then
- artistName = CleanArtistName(currentArtist("anv"))
- Else
- artistName = CleanArtistName(currentArtist("name"))
- End If
- WriteLog "ArtistName=" & artistName
- WriteLog "Without Track Info"
- role = currentArtist("role")
- NoSplit = False
- If InStr(role, ",") = 0 Then
- currentRole = Trim(role)
- zahl = 1
- NoSplit = True
- Else
- rolea = CheckSpecialRole(role)
- zahl = UBound(rolea)
- End If
- WriteLog "Role count=" & zahl
- For zahltemp = 1 To zahl
- If NoSplit = False Then
- currentRole = Trim(rolea(zahltemp))
- End If
- WriteLog "currentRole=" & currentRole
- If LookForFeaturing(currentRole) And CheckIgnoreFeatArtist = False Then
- WriteLog "Featuring found"
- If InStr(AlbumFeaturing, artistName) = 0 Then
- If AlbumFeaturing = "" Then
- If CheckFeaturingName Then
- AlbumFeaturing = TxtFeaturingName & " " & artistName
- Else
- AlbumFeaturing = currentRole & " " & artistName
- End If
- Else
- AlbumFeaturing = AlbumFeaturing & ArtistSeparator & artistName
- End If
- End If
- Else
- Do
- tmp = searchKeyword(LyricistKeywords, currentRole, AlbumLyricist, artistName)
- If tmp <> "" And tmp <> "ALREADY_INSIDE_ROLE" Then
- AlbumLyricist = tmp
- WriteLog "AlbumLyricist=" & AlbumLyricist
- Exit Do
- ElseIf tmp = "ALREADY_INSIDE_ROLE" Then
- WriteLog "ALREADY_INSIDE_ROLE"
- Exit Do
- End If
- tmp = searchKeyword(ConductorKeywords, currentRole, AlbumConductor, artistName)
- If tmp <> "" And tmp <> "ALREADY_INSIDE_ROLE" Then
- AlbumConductor = tmp
- WriteLog "AlbumConductor=" & AlbumConductor
- Exit Do
- ElseIf tmp = "ALREADY_INSIDE_ROLE" Then
- WriteLog "ALREADY_INSIDE_ROLE"
- Exit Do
- End If
- tmp = searchKeyword(ProducerKeywords, currentRole, AlbumProducer, artistName)
- If tmp <> "" And tmp <> "ALREADY_INSIDE_ROLE" Then
- AlbumProducer = tmp
- WriteLog "AlbumProducer=" & AlbumProducer
- Exit Do
- ElseIf tmp = "ALREADY_INSIDE_ROLE" Then
- WriteLog "ALREADY_INSIDE_ROLE"
- Exit Do
- End If
- tmp = searchKeyword(ComposerKeywords, currentRole, AlbumComposer, artistName)
- If tmp <> "" And tmp <> "ALREADY_INSIDE_ROLE" Then
- AlbumComposer = tmp
- WriteLog "AlbumComposer=" & AlbumComposer
- Exit Do
- ElseIf tmp = "ALREADY_INSIDE_ROLE" Then
- WriteLog "ALREADY_INSIDE_ROLE"
- Exit Do
- End If
- tmp2 = search_involved(Involved_R, currentRole)
- If tmp2 = -2 Then
- WriteLog "Ignore Role: '" & currentRole & "' (Unwanted tag)"
- ElseIf tmp2 = -1 Then
- ReDim Preserve Involved_R(UBound(Involved_R)+1)
- Involved_R(UBound(Involved_R)) = currentRole & ": " & artistName
- WriteLog "New Role: " & currentRole & ": " & artistName
- Else
- If InStr(Involved_R(tmp2), artistName) = 0 Then
- Involved_R(tmp2) = Involved_R(tmp2) & ArtistSeparator & artistName
- WriteLog "Role updated: " & Involved_R(tmp2)
- Else
- WriteLog "artist already inside role"
- End If
- End If
- Exit Do
- Loop While True
- End If
- Next
- Else
- If Not CheckUseAnv And currentArtist("anv") <> "" Then
- artistName = CleanArtistName(currentArtist("anv"))
- Else
- artistName = CleanArtistName(currentArtist("name"))
- End If
- WriteLog "ArtistName=" & artistName
- role = currentArtist("role")
- rTrack = currentArtist("tracks")
- If Left(rTrack, 7) = "tracks:" Then
- rTrack = Trim(Mid(rTrack, 8))
- End If
- WriteLog "Track(s)=" & rTrack
- WriteLog "Role(s)=" & role
- NoSplit = False
- If InStr(role, ",") <> 0 Then
- rolea = CheckSpecialRole(role)
- zahl = UBound(rolea)
- ElseIf InStr(role, " & ") <> 0 Then
- rolea = Split(role, "&")
- zahl = UBound(rolea)
- Else
- involvedRole = Trim(role)
- zahl = 1
- NoSplit = True
- End If
- For zahltemp = 1 To zahl
- If NoSplit = False Then
- involvedRole = Trim(rolea(zahltemp))
- End If
- WriteLog "involvedRole=" & involvedRole
- If InStr(rTrack, ",") = 0 And InStr(rTrack, " to ") = 0 And InStr(rTrack, " & ") = 0 Then
- currentTrack = rTrack
- Add_Track_Role currentTrack, artistName, involvedRole, TrackRoles, TrackArtist2, TrackPos, LeadingZeroTrackPosition
- End If
- If InStr(rTrack, ",") <> 0 Then
- tmp = Split(rTrack, ",")
- zahl2 = UBound(tmp)
- For zahltemp2 = 0 To zahl2
- currentTrack = Trim(tmp(zahltemp2))
- If InStr(currentTrack, " to ") <> 0 Then
- Track_from_to currentTrack, artistName, involvedRole, Title_Position, TrackRoles, TrackArtist2, TrackPos, LeadingZeroTrackPosition
- Else
- Add_Track_Role currentTrack, artistName, involvedRole, TrackRoles, TrackArtist2, TrackPos, LeadingZeroTrackPosition
- End If
- Next
- ElseIf InStr(rTrack, " to ") <> 0 Then
- currentTrack = Trim(rTrack)
- Track_from_to currentTrack, artistName, involvedRole, Title_Position, TrackRoles, TrackArtist2, TrackPos, LeadingZeroTrackPosition
- ElseIf InStr(rTrack, " & ") <> 0 Then
- tmp = Split(rTrack, " & ")
- zahl2 = UBound(tmp)
- For zahltemp2 = 0 To zahl2
- currentTrack = Trim(tmp(zahltemp2))
- Add_Track_Role currentTrack, artistName, involvedRole, TrackRoles, TrackArtist2, TrackPos, LeadingZeroTrackPosition
- Next
- End If
- Next
- End If
- Next
- End If
- ' Get track titles and track artists
- WriteLog " "
- WriteLog "--------------------------------------------------------------"
- iAutoTrackNumber = 1
- iAutoDiscNumber = 1
- iAutoDiscFormat = ""
- iTrackNum = 0
- cSubTrack = -1
- subTrackTitle = ""
- CharSeparatorSubTrack = 0
- Rem CharSeparatorSubTrack: 0 = nothing 1 = "." 2 = a-z
- Rem subTrackStart = 1 '0 = Song -1 1 = First Song
- 'Workaround for using "." as separator at discogs -----------------------------------------------------------------------------------------------------------
- tmp = 0 : tmp2 = 0
- NoSubTrackUsing = False
- For t = 0 To UBound(Title_Position)-1
- If Title_Position(t) <> "" Then
- tmp2 = tmp2 + 1
- End If
- If InStr(Title_Position(t), ".") <> 0 Then tmp = tmp + 1
- Next
- If tmp = tmp2 And tmp <> 0 Then NoSubTrackUsing = True 'all tracks have "." in position tag, this can't be a subtrack
- WriteLog "NoSubTrackUsing = " & NoSubTrackUsing
- 'Workaround for using "." as separator at discogs -----------------------------------------------------------------------------------------------------------
- WriteLog "Track count from Title_position=" & UBound(Title_Position)
- Dim NewSubTrackFound, cNewSubTrack
- NewSubTrackFound = False
- For t = 0 To UBound(Title_Position)-1
- WriteLog " "
- WriteLog "Process next track"
- WriteLog "Track=" & t
- WriteLog "Title_position=" & Title_Position(t)
- SDB.ProcessMessages
- If rSubPosition.Item(t) <> "" And rSubPosition.Item(t) <> "NewSubTrack" Then
- WriteLog "Processing Subtrack"
- Set currentTrack = CurrentRelease("tracklist")(CInt(rTrackPosition.Item(t)))("sub_tracks")(cInt(rSubPosition.Item(t)))
- Else
- Set currentTrack = CurrentRelease("tracklist")(CInt(rTrackPosition.Item(t)))
- End If
- position = currentTrack("position")
- If Right(position, 1) = "." Then position = Left(position, Len(position)-1)
- If NoSubTrackUsing = True Then position = Replace(position, ".", "-")
- trackname = PackSpaces(DecodeHtmlChars(TitleList(t)), True)
- WriteLog "Trackname=" & trackname
- WriteLog "Position=" & position
- ' WriteLog "t=" & t
- WriteLog "rSubPosition(t)=" & rSubPosition.item(t)
- Durations.Add currentTrack("duration")
- position = exchange_roman_numbers(position)
- If rSubPosition.Item(t) <> "" And rSubPosition.Item(t) <> "NewSubTrack" Then
- If NewSubTrackFound = False Then
- cNewSubTrack = t - 1
- If ArtistsList(t) <> "" then
- subTrackTitle = ArtistsList(t) & " - " & trackName
- Else
- subTrackTitle = trackName
- End If
- If NewResult = True Then
- UnselectedTracks(iTrackNum) = "x"
- UnselectedTrackNames(iTrackNum) = "x"
- End If
- NewSubTrackFound = True
- WriteLog "New Subtrack"
- Else
- If ArtistsList(t) <> "" then
- subTrackTitle = subTrackTitle & SubTrackSeparator & ArtistsList(t) & " - " & trackName
- Else
- subTrackTitle = subTrackTitle & SubTrackSeparator & trackName
- End If
- If NewResult = True Then
- UnselectedTracks(iTrackNum) = "x"
- UnselectedTrackNames(iTrackNum) = "x"
- End If
- WriteLog "More Subtrack"
- End If
- If t = (UBound(Title_Position) - 1) Then 'if last track and subtrack then add to subtrack songlist
- If SubTrackNameSelection = False Then
- Tracks.Item(cNewSubTrack) = Tracks.Item(cNewSubTrack) & " (" & subTrackTitle & ")"
- Else
- Tracks.Item(cNewSubTrack) = subTrackTitle
- End If
- End If
- Else
- If NewSubTrackFound = True Then
- If SubTrackNameSelection = False Then
- Tracks.Item(cNewSubTrack) = Tracks.Item(cNewSubTrack) & " (" & subTrackTitle & ")"
- Else
- Tracks.Item(cNewSubTrack) = subTrackTitle
- End If
- If NewResult = True Then
- UnselectedTracks(cNewSubTrack) = ""
- UnselectedTrackNames(cNewSubTrack) = ""
- End If
- NewSubTrackFound = False
- cNewSubTrack = -1
- WriteLog "Subtrack end"
- End If
- End If
- pos = 0
- If InStr(LCase(position), "-") > 0 And position <> "-" Then
- pos = InStr(LCase(position), "-")
- End If
- ' Here comes the new track/disc numbering methods
- If position <> "" And rSubPosition.Item(t) = "" Then
- If CheckTurnOffSubTrack = False Then
- If (cSubTrack <> -1 And InStr(LCase(position), ".") = 0 And CharSeparatorSubTrack = 1) Or (cSubTrack <> -1 And IsNumeric(Right(position, 1)) And CharSeparatorSubTrack = 2) Or position = "-" Then
- WriteLog "End of Subtrack found"
- If SubTrackNameSelection = False Then
- Tracks.Item(cSubTrack) = Tracks.Item(cSubTrack) & " (" & subTrackTitle & ")"
- Else
- Tracks.Item(cSubTrack) = subTrackTitle
- End If
- cSubTrack = -1
- subTrackTitle = ""
- CharSeparatorSubTrack = 0
- End If
- If NoSubTrackUsing = False Then
- WriteLog "Calling Subtrack Function"
- CharSeparatorSubTrack = 0
- 'SubTrack Function ---------------------------------------------------------
- If InStr(LCase(position), ".") > 0 Then
- CharSeparatorSubTrack = 1
- ElseIf Not IsNumeric(Right(position, 1)) And Len(position) > 1 And position <> "Video" Then
- CharSeparatorSubTrack = 2
- End If
- WriteLog "CharSeparatorSubTrack = " & CharSeparatorSubTrack
- If CharSeparatorSubTrack <> 0 Then
- If cSubTrack <> -1 Then 'more subtrack
- WriteLog "More Subtrack"
- If CharSeparatorSubTrack = 1 Then
- tmp = Split(position, ".")
- If oldSubTrackNumber <> tmp(0) Then
- If SubTrackNameSelection = False Then
- Tracks.Item(cSubTrack) = Tracks.Item(cSubTrack) & " (" & subTrackTitle & ")"
- Else
- Tracks.Item(cSubTrack) = subTrackTitle
- End If
- cSubTrack = -1
- subTrackTitle = ""
- End If
- ElseIf CharSeparatorSubTrack = 2 Then
- tmp2 = FindSubTrackSplit(position)
- If oldSubTrackNumber <> tmp2 Then
- If SubTrackNameSelection = False Then
- Tracks.Item(cSubTrack) = Tracks.Item(cSubTrack) & " (" & subTrackTitle & ")"
- Else
- Tracks.Item(cSubTrack) = subTrackTitle
- End If
- cSubTrack = -1
- subTrackTitle = ""
- End If
- End If
- Else 'new subtrack
- WriteLog "New SubTrack found"
- If SubTrackNameSelection = False And iTrackNum > 0 Then
- cSubTrack = iTrackNum - 1
- Else
- cSubTrack = iTrackNum
- End If
- If CharSeparatorSubTrack = 1 Then
- tmp = Split(position, ".")
- oldSubTrackNumber = tmp(0)
- ElseIf CharSeparatorSubTrack = 2 Then
- oldSubTrackNumber = FindSubTrackSplit(position)
- If oldSubTrackNumber = "" Then oldSubTrackNumber = position
- End If
- WriteLog "oldSubTrackNumber=" & oldSubTrackNumber
- End If
- If subTrackTitle = "" Then
- If ArtistsList(t) <> "" Then
- subTrackTitle = ArtistsList(t) & " - " & trackName
- Else
- subTrackTitle = trackName
- End If
- If SubTrackNameSelection = False Then
- If iTrackNum > 0 Then
- If NewResult = True Then
- UnselectedTracks(iTrackNum-1) = ""
- UnselectedTracks(iTrackNum) = "x"
- UnselectedTrackNames(iTrackNum-1) = ""
- UnselectedTrackNames(iTrackNum) = "x"
- End If
- Else
- If NewResult = True Then
- UnselectedTracks(iTrackNum) = ""
- UnselectedTrackNames(iTrackNum) = ""
- End If
- End If
- Else
- If NewResult = True Then
- UnselectedTracks(iTrackNum) = ""
- UnselectedTrackNames(iTrackNum) = ""
- End If
- End If
- Else
- If ArtistsList(t) <> "" Then
- subTrackTitle = subTrackTitle & SubTrackSeparator & ArtistsList(t) & " - " & trackName
- Else
- subTrackTitle = subTrackTitle & SubTrackSeparator & trackName
- End If
- If NewResult = True Then
- UnselectedTracks(iTrackNum) = "x"
- UnselectedTrackNames(iTrackNum) = "x"
- End If
- End If
- 'SubTrack Function ---------------------------------------------------------
- End If
- End If
- End If
- trackNumbering pos, position, TracksNum, TracksCD, iTrackNum, FormatCnt
- ElseIf (trackName = "-" And rSubPosition.Item(t) <> "NewSubTrack") Then
- tracksNum.Add ""
- tracksCD.Add ""
- If NewResult = True Then
- UnselectedTracks(iTrackNum) = "x"
- UnselectedTrackNames(iTrackNum) = "x"
- End If
- ElseIf currentTrack("type_") = "heading" Then
- WriteLog "Heading-Track erkannt"
- If NewResult = True Or UnselectedTracks(iTrackNum) = "x" Then
- UnselectedTracks(iTrackNum) = "x"
- UnselectedTrackNames(iTrackNum) = "x"
- tracksNum.Add ""
- tracksCD.Add ""
- End If
- If UnselectedTracks(iTrackNum) = "" Then
- trackNumbering pos, position, TracksNum, TracksCD, iTrackNum, FormatCnt
- End If
- Else ' Nothing specified
- trackNumbering pos, position, TracksNum, TracksCD, iTrackNum, FormatCnt
- End If
- ReDim Involved_R_T(0)
- TrackInvolvedPeople = ""
- TrackComposers = ""
- TrackConductors = ""
- TrackProducers = ""
- TrackLyricists = ""
- TrackFeaturing = AlbumFeaturing
- If UBound(Involved_R) > 0 Then
- For tmp = 1 To UBound(Involved_R)
- ReDim Preserve Involved_R_T(tmp)
- Involved_R_T(tmp) = Involved_R(tmp)
- Next
- End If
- For tmp = 1 To UBound(TrackPos)
- If TrackPos(tmp) = position And position <> "" Then
- WriteLog "trackpos(" & tmp & ")=" & trackpos(tmp)
- involvedRole = TrackRoles(tmp)
- involvedArtist = TrackArtist2(tmp)
- If LookForFeaturing(involvedRole) And CheckIgnoreFeatArtist = False Then
- If InStr(TrackFeaturing, involvedArtist) = 0 Then
- If TrackFeaturing = "" Then
- If CheckFeaturingName Then
- TrackFeaturing = TxtFeaturingName & " " & involvedArtist
- Else
- TrackFeaturing = involvedRole & " " & involvedArtist
- End If
- Else
- TrackFeaturing = TrackFeaturing & ArtistSeparator & involvedArtist
- End If
- End If
- WriteLog "TrackFeaturing=" & TrackFeaturing
- Else
- Do
- ret = searchKeyword(LyricistKeywords, involvedRole, TrackLyricists, involvedArtist)
- If ret <> "" And ret <> "ALREADY_INSIDE_ROLE" Then
- TrackLyricists = ret
- WriteLog "TrackLyricists=" & TrackLyricists
- Exit Do
- ElseIf ret = "ALREADY_INSIDE_ROLE" Then
- WriteLog "ALREADY_INSIDE_ROLE"
- Exit Do
- End If
- ret = searchKeyword(ConductorKeywords, involvedRole, TrackConductors, involvedArtist)
- If ret <> "" And ret <> "ALREADY_INSIDE_ROLE" Then
- TrackConductors = ret
- WriteLog "TrackConductors=" & TrackConductors
- Exit Do
- ElseIf ret = "ALREADY_INSIDE_ROLE" Then
- WriteLog "ALREADY_INSIDE_ROLE"
- Exit Do
- End If
- ret = searchKeyword(ProducerKeywords, involvedRole, TrackProducers, involvedArtist)
- If ret <> "" And ret <> "ALREADY_INSIDE_ROLE" Then
- TrackProducers = ret
- WriteLog "TrackProducers=" & TrackProducers
- Exit Do
- ElseIf ret = "ALREADY_INSIDE_ROLE" Then
- WriteLog "ALREADY_INSIDE_ROLE"
- Exit Do
- End If
- ret = searchKeyword(ComposerKeywords, involvedRole, TrackComposers, involvedArtist)
- If ret <> "" And ret <> "ALREADY_INSIDE_ROLE" Then
- TrackComposers = ret
- WriteLog "TrackComposers=" & TrackComposers
- Exit Do
- ElseIf ret = "ALREADY_INSIDE_ROLE" Then
- WriteLog "ALREADY_INSIDE_ROLE"
- Exit Do
- End If
- tmp2 = search_involved(Involved_R_T, involvedRole)
- If tmp2 = -2 Then
- WriteLog "Ignore Role: '" & currentRole & "' (Unwanted tag)"
- ElseIf tmp2 = -1 Then
- ReDim Preserve Involved_R_T(UBound(Involved_R_T)+1)
- Involved_R_T(UBound(Involved_R_T)) = involvedRole & ": " & TrackArtist2(tmp)
- WriteLog "New Role: " & involvedRole & ": " & TrackArtist2(tmp)
- Else
- If InStr(Involved_R_T(tmp2), TrackArtist2(tmp)) = 0 Then
- Involved_R_T(tmp2) = Involved_R_T(tmp2) & ArtistSeparator & TrackArtist2(tmp)
- WriteLog "Role updated: " & Involved_R_T(tmp2)
- Else
- WriteLog "artist already inside role"
- End If
- End If
- Exit Do
- Loop While True
- End If
- End If
- SDB.ProcessMessages
- Next
- artistList = ""
- WriteLog " "
- WriteLog "Search for TrackArtist"
- If currentTrack.Exists("artists") Then
- tmp = getArtistsName(CurrentTrack, "artists", QueryPage)
- artistList = tmp(0)
- TrackFeaturing = tmp(1)
- End If
- If artistList = "" Then artistList = AlbumArtistTitle
- WriteLog "artistlist=" & artistlist
- WriteLog "rTrack=" & rTrackPosition.Item(t)
- REM WriteLog "ubound=" & UBound($currentTrack)
- If currentTrack.Exists("extraartists") Then
- WriteLog " "
- WriteLog "ExtraArtist found"
- For Each extra In currentTrack("extraartists")
- Set currentArtist = CurrentTrack("extraartists")(extra)
- If (currentArtist("anv") <> "") And Not CheckUseAnv Then
- involvedArtist = CleanArtistName(currentArtist("anv"))
- Else
- involvedArtist = CleanArtistName(currentArtist("name"))
- End If
- WriteLog "involvedArtist=" & involvedArtist
- If involvedArtist <> "" Then
- role = currentArtist("role")
- NoSplit = False
- If InStr(role, ",") = 0 Then
- involvedRole = Trim(role)
- zahl = 1
- NoSplit = True
- Else
- rolea = CheckSpecialRole(role)
- zahl = UBound(rolea)
- End If
- For zahltemp = 1 To zahl
- If NoSplit = False Then
- involvedRole = Trim(rolea(zahltemp))
- End If
- If LookForFeaturing(involvedRole) And CheckIgnoreFeatArtist = False Then
- If InStr(artistList, involvedArtist) = 0 Then
- If TrackFeaturing = "" Then
- If CheckFeaturingName Then
- TrackFeaturing = TxtFeaturingName & " " & involvedArtist
- Else
- TrackFeaturing = involvedRole & " " & involvedArtist
- End If
- Else
- If InStr(TrackFeaturing, involvedArtist) = 0 Then
- TrackFeaturing = TrackFeaturing & ArtistSeparator & involvedArtist
- End If
- End If
- End If
- Else
- Do
- tmp = searchKeyword(LyricistKeywords, involvedRole, TrackLyricists, involvedArtist)
- If tmp <> "" And tmp <> "ALREADY_INSIDE_ROLE" Then
- TrackLyricists = tmp
- WriteLog "TrackLyricists=" & TrackLyricists
- Exit Do
- ElseIf tmp = "ALREADY_INSIDE_ROLE" Then
- WriteLog "ALREADY_INSIDE_ROLE"
- Exit Do
- End If
- tmp = searchKeyword(ConductorKeywords, involvedRole, TrackConductors, involvedArtist)
- If tmp <> "" And tmp <> "ALREADY_INSIDE_ROLE" Then
- TrackConductors = tmp
- WriteLog "TrackConductors=" & TrackConductors
- Exit Do
- ElseIf tmp = "ALREADY_INSIDE_ROLE" Then
- WriteLog "ALREADY_INSIDE_ROLE"
- Exit Do
- End If
- tmp = searchKeyword(ProducerKeywords, involvedRole, TrackProducers, involvedArtist)
- If tmp <> "" And tmp <> "ALREADY_INSIDE_ROLE" Then
- TrackProducers = tmp
- WriteLog "TrackProducers=" & TrackProducers
- Exit Do
- ElseIf tmp = "ALREADY_INSIDE_ROLE" Then
- WriteLog "ALREADY_INSIDE_ROLE"
- Exit Do
- End If
- tmp = searchKeyword(ComposerKeywords, involvedRole, TrackComposers, involvedArtist)
- If tmp <> "" And tmp <> "ALREADY_INSIDE_ROLE" Then
- TrackComposers = tmp
- WriteLog "TrackComposers=" & TrackComposers
- Exit Do
- ElseIf tmp = "ALREADY_INSIDE_ROLE" Then
- WriteLog "ALREADY_INSIDE_ROLE"
- Exit Do
- End If
- tmp2 = search_involved(Involved_R_T, involvedRole)
- If tmp2 = -2 Then
- WriteLog "Ignore Role: '" & currentRole & "' (Unwanted tag)"
- ElseIf tmp2 = -1 Then
- ReDim Preserve Involved_R_T(UBound(Involved_R_T)+1)
- Involved_R_T(UBound(Involved_R_T)) = involvedRole & ": " & involvedArtist
- WriteLog "New Role: " & involvedRole & ": " & involvedArtist
- Else
- If InStr(Involved_R_T(tmp2), involvedArtist) = 0 Then
- Involved_R_T(tmp2) = Involved_R_T(tmp2) & ArtistSeparator & involvedArtist
- WriteLog "Role updated: " & Involved_R_T(tmp2)
- Else
- WriteLog "artist already inside role"
- End If
- End If
- Exit Do
- Loop While True
- End If
- Next
- End If
- SDB.ProcessMessages
- Next
- WriteLog "ExtraArtist end"
- End If
- If TrackFeaturing <> "" And CheckIgnoreFeatArtist = False Then
- If CheckTitleFeaturing = True Then
- tmp = InStrRev(TrackFeaturing, ArtistSeparator)
- If tmp = 0 Or ArtistLastSeparator = False Then
- trackName = trackName & " (" & TrackFeaturing & ")"
- Else
- trackName = trackName & " (" & Left(TrackFeaturing, tmp-1) & " & " & Mid(TrackFeaturing, tmp+Len(ArtistSeparator)) & ")"
- End If
- Else
- tmp = InStrRev(TrackFeaturing, ArtistSeparator)
- If tmp = 0 Or ArtistLastSeparator = False Then
- If Left(TrackFeaturing, 1) = "," Or Left(TrackFeaturing, 1) = ";" Then
- artistList = artistList & TrackFeaturing
- Else
- artistList = artistList & " " & TrackFeaturing
- End If
- Else
- artistList = artistList & " " & Left(TrackFeaturing, tmp-1) & " & " & Mid(TrackFeaturing, tmp+Len(ArtistSeparator))
- End If
- End If
- End If
- ArtistTitles.Add artistList
- If position <> "" Then
- TrackLyricists = FindArtist(TrackLyricists, AlbumLyricist)
- If AlbumLyricist <> "" and TrackLyricists <> "" Then
- Lyricists.Add AlbumLyricist & Separator & TrackLyricists
- Else
- Lyricists.Add AlbumLyricist & TrackLyricists
- End If
- TrackComposers = FindArtist(TrackComposers, AlbumComposer)
- If AlbumComposer <> "" and TrackComposers <> "" Then
- Composers.Add AlbumComposer & Separator & TrackComposers
- Else
- Composers.Add AlbumComposer & TrackComposers
- End If
- TrackConductors = FindArtist(TrackConductors, AlbumConductor)
- If AlbumConductor <> "" and TrackConductors <> "" Then
- Conductors.Add AlbumConductor & Separator & TrackConductors
- Else
- Conductors.Add AlbumConductor & TrackConductors
- End If
- TrackProducers = FindArtist(TrackProducers, AlbumProducer)
- If AlbumProducer <> "" and TrackProducers <> "" Then
- Producers.Add AlbumProducer & Separator & TrackProducers
- Else
- Producers.Add AlbumProducer & TrackProducers
- End If
- If UBound(Involved_R_T) > 0 Then
- For tmp = 1 To UBound(involved_R_T)
- TrackInvolvedPeople = TrackInvolvedPeople & Involved_R_T(tmp) & Separator
- Next
- TrackInvolvedPeople = Left(TrackInvolvedPeople, Len(TrackInvolvedPeople)-Len(Separator))
- Else
- TrackInvolvedPeople = ""
- End If
- InvolvedArtists.Add TrackInvolvedPeople
- If CheckReplaceAccentChar = True Then
- trackName = Replace(trackName, ChrW(8245), "'")
- trackName = Replace(trackName, ChrW(8246), "'")
- trackName = Replace(trackName, ChrW(8242), "'")
- trackName = Replace(trackName, ChrW(8243), "'")
- trackName = Replace(trackName, Chr(145), "'")
- trackName = Replace(trackName, Chr(146), "'")
- trackName = Replace(trackName, Chr(147), "'")
- trackName = Replace(trackName, Chr(148), "'")
- End If
- Tracks.Add trackName
- Else
- Lyricists.Add ""
- Composers.Add ""
- Conductors.Add ""
- Producers.Add ""
- InvolvedArtists.Add ""
- If CheckReplaceAccentChar = True Then
- trackName = Replace(trackName, ChrW(8245), "'")
- trackName = Replace(trackName, ChrW(8246), "'")
- trackName = Replace(trackName, ChrW(8242), "'")
- trackName = Replace(trackName, ChrW(8243), "'")
- trackName = Replace(trackName, Chr(145), "'")
- trackName = Replace(trackName, Chr(146), "'")
- trackName = Replace(trackName, Chr(147), "'")
- trackName = Replace(trackName, Chr(148), "'")
- End If
- Tracks.Add trackName
- End If
- iTrackNum = iTrackNum + 1
- Next
- If cSubTrack <> -1 Then
- If CheckReplaceAccentChar = True Then
- subTrackTitle = Replace(subTrackTitle, ChrW(8245), "'")
- subTrackTitle = Replace(subTrackTitle, ChrW(8246), "'")
- subTrackTitle = Replace(subTrackTitle, ChrW(8242), "'")
- subTrackTitle = Replace(subTrackTitle, ChrW(8243), "'")
- subTrackTitle = Replace(subTrackTitle, Chr(145), "'")
- subTrackTitle = Replace(subTrackTitle, Chr(146), "'")
- subTrackTitle = Replace(subTrackTitle, Chr(147), "'")
- subTrackTitle = Replace(subTrackTitle, Chr(148), "'")
- End If
- If SubTrackNameSelection = False Then
- Tracks.Item(cSubTrack) = Tracks.Item(cSubTrack) & " (" & subTrackTitle & ")"
- Else
- Tracks.Item(cSubTrack) = subTrackTitle
- End If
- cSubTrack = -1
- subTrackTitle = ""
- CharSeparatorSubTrack = 0
- End If
- ' Get album title
- AlbumTitle = PackSpaces(currentRelease("title"), True)
- ' Get Album art URL
- If CurrentRelease.Exists("images") Then
- For Each i In CurrentRelease("images")
- Set currentImage = CurrentRelease("images")(i)
- If currentImage("type") = "primary" Or AlbumArtURL = "" Then
- AlbumArtURL = currentImage("resource_url")
- WriteLog "AlbumArtURL2=" & AlbumArtURL
- AlbumArtThumbNail = currentImage("uri150")
- WriteLog "AlbumArtThumbNail2=" & AlbumArtThumbNail
- End If
- Next
- End If
- If AlbumArtThumbNail <> "" Then
- ret = getimages(AlbumArtThumbNail, sTemp & "cover.jpg")
- AlbumArtThumbNail = sTemp & "cover.jpg"
- End If
- '----------------------------------DiscogsImages----------------------------------------
- Set ImageList = SDB.NewStringList
- Set SaveImageType = SDB.NewStringList
- Set SaveImage = SDB.NewStringList
- ImagesCount = 0
- If CurrentRelease.Exists("images") Then
- ImagesCount = CurrentRelease("images").Count
- WriteLog "ImagesCount=" & ImagesCount
- If ImagesCount > 1 Then
- For Each i In CurrentRelease("images")
- Set currentImage = CurrentRelease("images")(i)
- tmpArt = currentImage("resource_url")
- WriteLog tmpArt
- If AlbumArtURL <> tmpArt Then
- ImageList.add tmpArt
- SaveImageType.add "other"
- SaveImage.add "0"
- End If
- Next
- End If
- End If
- '----------------------------------DiscogsImages----------------------------------------
- ' Get Master ID
- If CurrentRelease.Exists("master_id") Then
- theMaster = currentRelease("master_id")
- If SavedMasterID <> theMaster Then
- OriginalDateRead = ReloadMaster(theMaster)
- SavedMasterID = theMaster
- End If
- ElseIf CurrentRelease.Exists("main_release") Then 'Master
- If CurrentRelease.Exists("year") Then
- OriginalDateRead = CurrentRelease("year")
- End If
- SavedMasterID = currentRelease("id")
- Else
- theMaster = ""
- SavedMasterID = theMaster
- OriginalDateRead = ""
- End If
- ' Get release year/date
- If CurrentRelease.Exists("released") Then
- ReleaseDateRead = CurrentRelease("released")
- If Len(ReleaseDateRead) > 4 Then
- ReleaseSplit = Split(ReleaseDateRead,"-")
- If ReleaseSplit(2) = "00" Then
- ReleaseDateRead = Left(ReleaseDateRead, 4)
- Else
- ReleaseDateRead = ReleaseSplit(2) & "-" & ReleaseSplit(1) & "-" & ReleaseSplit(0)
- End If
- If CheckYearOnlyDate Then
- ReleaseDateRead = Right(ReleaseDateRead, 4)
- End If
- End If
- Else
- ReleaseDateRead = ""
- End If
- WriteLog "ReleaseDateRead=" & ReleaseDateRead
- 'Set OriginalDate
- If OriginalDateRead <> "" Then
- If Len(OriginalDateRead) > 4 Then
- ReleaseSplit = Split(OriginalDateRead,"-")
- If ReleaseSplit(2) = "00" Then
- OriginalDateRead = Left(OriginalDateRead, 4)
- Else
- OriginalDateRead = ReleaseSplit(2) & "-" & ReleaseSplit(1) & "-" & ReleaseSplit(0)
- End If
- If CheckYearOnlyDate Then
- OriginalDateRead = Right(OriginalDateRead, 4)
- End If
- End If
- End If
- WriteLog "OriginalDateRead=" & OriginalDateRead
- 'Choose Date field saving
- If StoreDate = 0 Then
- ReleaseDate = ReleaseDateRead
- OriginalDate = OriginalDateRead
- WriteLog "Use StoreDate=Default"
- ElseIf StoreDate = 1 Then
- ReleaseDate = ReleaseDateRead
- OriginalDate = ReleaseDateRead
- WriteLog "Use release date for both date fields"
- ElseIf StoreDate = 2 Then
- ReleaseDate = OriginalDateRead
- OriginalDate = OriginalDateRead
- WriteLog "Use original date for both date fields"
- End If
- WriteLog "ReleaseDate=" & ReleaseDate
- WriteLog "OriginalDate=" & OriginalDate
- ' Get genres
- If GenresSelect.Count > 0 Then
- tmp2 = true
- Else
- tmp2 = false
- End If
- For Each g In CurrentRelease("genres")
- REM AddToField Genres, CurrentRelease("genres")(g)
- tmp = false
- If GenresList.Count > 0 Then
- For x = 0 to GenresList.Count -1
- If LCase(GenresList.Item(x)) = LCase(CurrentRelease("genres")(g)) Then tmp = true
- Next
- End If
- If tmp = false Then
- GenresList.Add CurrentRelease("genres")(g)
- If tmp2 = false Then
- GenresSelect.Add True
- End If
- End If
- Next
- ' Get styles/moods/themes
- If CurrentRelease.Exists("styles") Then
- For Each s In CurrentRelease("styles")
- REM AddToField Styles, CurrentRelease("styles")(s)
- tmp = false
- If GenresList.Count > 0 Then
- For x = 0 to GenresList.Count -1
- If LCase(GenresList.Item(x)) = LCase(CurrentRelease("styles")(s)) Then tmp = true
- Next
- End If
- If tmp = false Then
- GenresList.Add CurrentRelease("styles")(s)
- If tmp2 = false Then
- GenresSelect.Add True
- End If
- End If
- Next
- End If
- ' Get Label
- If CurrentRelease.Exists("labels") Then
- For Each l in CurrentRelease("labels")
- Set currentLabel = CurrentRelease("labels")(l)
- If SavedLabelID = "" Then
- If currentLabel.Exists("id") Then
- SavedLabelID = currentLabel("id")
- End If
- End If
- If CheckDeleteDuplicatedEntry = True Then
- AddToFieldWD theLabels, CleanArtistName(currentLabel("name"))
- AddToFieldWD theCatalogs, currentLabel("catno")
- Else
- AddToField theLabels, CleanArtistName(currentLabel("name"))
- AddToField theCatalogs, currentLabel("catno")
- End If
- Next
- Else
- theLabels = ""
- theCatalogs = ""
- End If
- WriteLog "theLabels=" & theLabels
- WriteLog "theCatalogs=" & theCatalogs
- ' Get Country
- If CurrentRelease.Exists("country") Then
- theCountry = CurrentRelease("country")
- Else
- theCountry = ""
- End If
- WriteLog "country=" & theCountry
- ' Get Format
- If CurrentRelease.Exists("formats") Then
- For Each f in CurrentRelease("formats")
- Set currentFormat = CurrentRelease("formats")(f)
- If currentFormat("qty") > 1 And CheckShowQtyFormat = True Then
- AddToField theFormat, currentFormat("qty") & " x " & currentFormat("name")
- Else
- AddToField theFormat, currentFormat("name")
- End If
- If currentFormat.Exists("descriptions") Then
- For Each d in currentFormat("descriptions")
- theFormat = theFormat & FormatSeparator & currentFormat("descriptions")(d)
- Next
- End If
- Next
- Else
- theFormat = ""
- End If
- WriteLog "theformat=" & theFormat
- ' Get Comment
- If CurrentRelease.Exists("notes") Then
- Comment = CurrentRelease("notes")
- Else
- Comment = ""
- End If
- WriteLog "Comment=" & Comment
- ' Get data_quality
- If CurrentRelease.Exists("data_quality") Then
- DataQuality = CurrentRelease("data_quality")
- Else
- DataQuality = ""
- End If
- WriteLog "DataQuality=" & DataQuality
- End If
- '-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
- If QueryPage = "MusicBrainz" Then
- For Each m In CurrentRelease("media")
- Set currentMedia = CurrentRelease("media")(m)
- For Each track In CurrentMedia("tracks")
- Set currentTrack = CurrentMedia("tracks")(track)
- position = currentTrack("number")
- DiscogsTracksNum.Add position
- position = exchange_roman_numbers(position)
- ReDim Preserve Title_Position(UBound(Title_Position)+1)
- Title_Position(UBound(Title_Position)) = position
- ReDim Preserve Grouping(UBound(Grouping)+1)
- Grouping(UBound(Grouping)) = ""
- Next
- Next
- 'Check for leading zero in track-position
- 'LeadingZeroTrackPosition = CheckLeadingZeroTrackPosition(Title_Position(1))
- ' Get release artist
- tmp = getArtistsName(CurrentRelease, "artist-credit", QueryPage)
- If tmp(1) <> "" Then
- AlbumArtistTitle = tmp(0) & " " & tmp(1)
- Else
- AlbumArtistTitle = tmp(0)
- End If
- AlbumArtist = tmp(2)
- Writelog "AlbumArtistTitle=" & AlbumArtistTitle
- If (Not CheckAlbumArtistFirst) Then
- AlbumArtist = AlbumArtistTitle
- End If
- If AlbumArtist = "Various Artists" And CheckVarious Then
- AlbumArtist = TxtVarious
- End If
- If AlbumArtistTitle = "Various Artists" And CheckVarious Then
- AlbumArtistTitle = TxtVarious
- End If
- WriteLog " "
- WriteLog "ExtraArtists for Release"
- If currentRelease.Exists("relations") Then
- If currentRelease("relations").Count > 0 Then
- For Each extraArtist In CurrentRelease("relations")
- WriteLog " "
- Set currentArtist = CurrentRelease("relations")(extraArtist)
- artistName = CleanArtistName(currentArtist("artist")("name"))
- WriteLog "ArtistName=" & artistName
- ret = RelationshipTypes(currentArtist)
- If ret(0) > 0 Then
- For i = 1 to ret(0)
- currentRole = ret(i)
- Do
- tmp = searchKeyword(LyricistKeywords, currentRole, AlbumLyricist, artistName)
- If tmp <> "" And tmp <> "ALREADY_INSIDE_ROLE" Then
- AlbumLyricist = tmp
- WriteLog "AlbumLyricist=" & AlbumLyricist
- Exit Do
- ElseIf tmp = "ALREADY_INSIDE_ROLE" Then
- WriteLog "ALREADY_INSIDE_ROLE"
- Exit Do
- End If
- tmp = searchKeyword(ConductorKeywords, currentRole, AlbumConductor, artistName)
- If tmp <> "" And tmp <> "ALREADY_INSIDE_ROLE" Then
- AlbumConductor = tmp
- WriteLog "AlbumConductor=" & AlbumConductor
- Exit Do
- ElseIf tmp = "ALREADY_INSIDE_ROLE" Then
- WriteLog "ALREADY_INSIDE_ROLE"
- Exit Do
- End If
- tmp = searchKeyword(ProducerKeywords, currentRole, AlbumProducer, artistName)
- If tmp <> "" And tmp <> "ALREADY_INSIDE_ROLE" Then
- AlbumProducer = tmp
- WriteLog "AlbumProducer=" & AlbumProducer
- Exit Do
- ElseIf tmp = "ALREADY_INSIDE_ROLE" Then
- WriteLog "ALREADY_INSIDE_ROLE"
- Exit Do
- End If
- tmp = searchKeyword(ComposerKeywords, currentRole, AlbumComposer, artistName)
- If tmp <> "" And tmp <> "ALREADY_INSIDE_ROLE" Then
- AlbumComposer = tmp
- WriteLog "AlbumComposer=" & AlbumComposer
- Exit Do
- ElseIf tmp = "ALREADY_INSIDE_ROLE" Then
- WriteLog "ALREADY_INSIDE_ROLE"
- Exit Do
- End If
- tmp2 = search_involved(Involved_R, currentRole)
- If tmp2 = -2 Then
- WriteLog "Ignore Role: '" & currentRole & "' (Unwanted tag)"
- ElseIf tmp2 = -1 Then
- ReDim Preserve Involved_R(UBound(Involved_R)+1)
- Involved_R(UBound(Involved_R)) = currentRole & ": " & artistName
- WriteLog "New Role: " & currentRole & ": " & artistName
- Else
- If InStr(Involved_R(tmp2), artistName) = 0 Then
- Involved_R(tmp2) = Involved_R(tmp2) & ArtistSeparator & artistName
- WriteLog "Role updated: " & Involved_R(tmp2)
- Else
- WriteLog "artist already inside role"
- End If
- End If
- Exit Do
- Loop While True
- Next
- End If
- Next
- End If
- End If
- ' Get track titles and track artists
- WriteLog "End"
- iAutoTrackNumber = 1
- iAutoDiscNumber = 1
- iTrackNum = 0
- For Each m In CurrentRelease("media")
- Set currentMedia = CurrentRelease("media")(m)
- If CheckNoDisc = False Then
- iAutoTrackNumber = 1
- End If
- For Each t In CurrentMedia("tracks")
- Set currentTrack = currentMedia("tracks")(t)
- position = currentTrack("number")
- trackName = PackSpaces(DecodeHtmlChars(currentTrack("title")), False)
- length = currentTrack("length")
- If length <> "" And IsNumeric(length) Then
- min = Int(length / 60000)
- tmp = (length / 60000) - Int(length / 60000)
- If tmp <> 0 Then
- sec = Round(tmp * 60, 0)
- End If
- If sec < 10 Then
- length = CStr(min & ":" & "0" & sec)
- Else
- length = CStr(min & ":" & sec)
- End If
- Durations.Add length
- Else
- Durations.Add ""
- End If
- WriteLog " "
- WriteLog " "
- WriteLog "Position=" & position
- WriteLog "TrackName=" & trackname
- WriteLog "Duration=" & length
- ' Here comes the new track/disc numbering methods
- If position <> "" Then
- If CurrentRelease("media").Count > 1 Then ' More than 1 CD
- If CheckNoDisc = True Then
- TracksCD.Add ""
- Else
- TracksCD.Add LeadingZeroDisc(CurrentMedia("position"))
- End If
- Else
- If CheckForceDisc = True Then
- TracksCD.Add LeadingZeroDisc("1")
- Else
- TracksCD.Add ""
- End If
- End If
- If UnselectedTracks(iTrackNum) <> "x" Then
- If CheckLeadingZero = True And iAutoTrackNumber < 10 Then
- tracksNum.Add "0" & iAutoTrackNumber
- WriteLog "Tracknumber=" & iAutoTrackNumber
- Else
- tracksNum.Add iAutoTrackNumber
- WriteLog "Tracknumber=" & iAutoTrackNumber
- End If
- iAutoTrackNumber = iAutoTrackNumber + 1
- Else
- tracksNum.Add ""
- End If
- ElseIf currentTrack("length") = "" And currentTrack("title") = "-" Then
- tracksNum.Add ""
- tracksCD.Add ""
- UnselectedTracks(iTrackNum) = "x"
- UnselectedTrackNames(iTrackNum) = "x"
- Else ' Nothing specified
- If CheckForceNumeric And UnselectedTracks(iTrackNum) <> "x" Then
- If CheckLeadingZero = True And iAutoTrackNumber < 10 Then
- tracksNum.Add "0" & iAutoTrackNumber
- WriteLog "Tracknumber=" & iAutoTrackNumber
- Else
- tracksNum.Add iAutoTrackNumber
- WriteLog "Tracknumber=" & iAutoTrackNumber
- End If
- iAutoTrackNumber = iAutoTrackNumber + 1
- Else
- tracksNum.Add ""
- End If
- If CheckForceDisc Then
- tracksCD.Add LeadingZeroDisc(iAutoDiscNumber)
- Else
- tracksCD.Add ""
- End If
- End If
- ReDim Involved_R_T(0)
- TrackInvolvedPeople = ""
- TrackComposers = ""
- TrackConductors = ""
- TrackProducers = ""
- TrackLyricists = ""
- TrackFeaturing = AlbumFeaturing
- If UBound(Involved_R) > 0 Then
- For tmp = 1 To UBound(Involved_R)
- ReDim Preserve Involved_R_T(tmp)
- Involved_R_T(tmp) = Involved_R(tmp)
- Next
- End If
- For tmp = 1 To UBound(TrackPos)
- If TrackPos(tmp) = position Then
- WriteLog "trackpos(" & tmp & ")=" & trackpos(tmp)
- involvedRole = TrackRoles(tmp)
- involvedArtist = TrackArtist2(tmp)
- If LookForFeaturing(involvedRole) And CheckIgnoreFeatArtist = False Then
- If InStr(TrackFeaturing, involvedArtist) = 0 Then
- If TrackFeaturing = "" Then
- If CheckFeaturingName Then
- TrackFeaturing = TxtFeaturingName & " " & involvedArtist
- Else
- TrackFeaturing = involvedRole & " " & involvedArtist
- End If
- Else
- TrackFeaturing = TrackFeaturing & ArtistSeparator & involvedArtist
- End If
- End If
- WriteLog "TrackFeaturing=" & TrackFeaturing
- Else
- Do
- ret = searchKeyword(LyricistKeywords, involvedRole, TrackLyricists, involvedArtist)
- If ret <> "" And ret <> "ALREADY_INSIDE_ROLE" Then
- TrackLyricists = ret
- WriteLog "TrackLyricists=" & TrackLyricists
- Exit Do
- ElseIf ret = "ALREADY_INSIDE_ROLE" Then
- WriteLog "ALREADY_INSIDE_ROLE"
- Exit Do
- End If
- ret = searchKeyword(ConductorKeywords, involvedRole, TrackConductors, involvedArtist)
- If ret <> "" And ret <> "ALREADY_INSIDE_ROLE" Then
- TrackConductors = ret
- WriteLog "TrackConductors=" & TrackConductors
- Exit Do
- ElseIf ret = "ALREADY_INSIDE_ROLE" Then
- WriteLog "ALREADY_INSIDE_ROLE"
- Exit Do
- End If
- ret = searchKeyword(ProducerKeywords, involvedRole, TrackProducers, involvedArtist)
- If ret <> "" And ret <> "ALREADY_INSIDE_ROLE" Then
- TrackProducers = ret
- WriteLog "TrackProducers=" & TrackProducers
- Exit Do
- ElseIf ret = "ALREADY_INSIDE_ROLE" Then
- WriteLog "ALREADY_INSIDE_ROLE"
- Exit Do
- End If
- ret = searchKeyword(ComposerKeywords, involvedRole, TrackComposers, involvedArtist)
- If ret <> "" And ret <> "ALREADY_INSIDE_ROLE" Then
- TrackComposers = ret
- WriteLog "TrackComposers=" & TrackComposers
- Exit Do
- ElseIf ret = "ALREADY_INSIDE_ROLE" Then
- WriteLog "ALREADY_INSIDE_ROLE"
- Exit Do
- End If
- tmp2 = search_involved(Involved_R_T, involvedRole)
- If tmp2 = -2 Then
- WriteLog "Ignore Role: '" & currentRole & "' (Unwanted tag)"
- ElseIf tmp2 = -1 Then
- ReDim Preserve Involved_R_T(UBound(Involved_R_T)+1)
- Involved_R_T(UBound(Involved_R_T)) = involvedRole & ": " & TrackArtist2(tmp)
- WriteLog "New Role: " & involvedRole & ": " & TrackArtist2(tmp)
- Else
- If InStr(Involved_R_T(tmp2), TrackArtist2(tmp)) = 0 Then
- Involved_R_T(tmp2) = Involved_R_T(tmp2) & ArtistSeparator & TrackArtist2(tmp)
- WriteLog "Role updated: " & Involved_R_T(tmp2)
- Else
- WriteLog "artist already inside role"
- End If
- End If
- Exit Do
- Loop While True
- End If
- End If
- Next
- artistList = ""
- WriteLog " "
- WriteLog "Search for TrackArtist <> Release Artist"
- If currentTrack.Exists("artist-credit") Then
- tmp = getArtistsName(CurrentTrack, "artist-credit", QueryPage)
- artistList = tmp(0)
- TrackFeaturing = Trim(tmp(1))
- End If
- If artistList = "" Then artistList = AlbumArtistTitle
- WriteLog "artistlist=" & artistlist
- Set tmp = currentTrack("recording")
- If tmp.Exists("relations") Then
- If tmp("relations").Count > 0 Then
- For Each tmp2 in tmp("relations")
- WriteLog " "
- involvedArtist = ""
- Set tmp3 = tmp("relations")(tmp2)
- If tmp3.Exists("work") And tmp3("type") <> "other version" Then
- Set tmp3 = tmp("relations")(tmp2)("work")
- For Each tmp4 In tmp3("relations")
- If tmp3("relations")(tmp4).Exists("artist") Then
- involvedArtist = CleanArtistName(tmp3("relations")(tmp4)("artist")("name"))
- Else
- involvedArtist = ""
- End If
- involvedRole = ""
- Set tmp5 = tmp3("relations")(tmp4)
- If tmp5.Exists("attributes") Then
- ret = RelationshipTypes(tmp5)
- If ret(0) > 0 Then
- For i = 1 to ret(0)
- If involvedArtist <> "" Then getinvolvedRole involvedArtist, ret(i), artistList, TrackFeaturing, Involved_R_T, TrackComposers, TrackConductors, TrackProducers, TrackLyricists
- Next
- End If
- End If
- Next
- Else
- If tmp3.Exists("artist") Then
- involvedArtist = CleanArtistName(tmp3("artist")("name"))
- Else
- involvedArtist = ""
- End If
- ret = RelationshipTypes(tmp3)
- If ret(0) > 0 Then
- For i = 1 to ret(0)
- If involvedArtist <> "" Then getinvolvedRole involvedArtist, ret(i), artistList, TrackFeaturing, Involved_R_T, TrackComposers, TrackConductors, TrackProducers, TrackLyricists
- Next
- End If
- End If
- Next
- End If
- End If
- WriteLog "TrackArtist end"
- If TrackFeaturing <> "" And CheckIgnoreFeatArtist = False Then
- If CheckTitleFeaturing = True Then
- tmp = InStrRev(TrackFeaturing, ArtistSeparator)
- If tmp = 0 Or ArtistLastSeparator = False Then
- trackName = trackName & " (" & TrackFeaturing & ")"
- Else
- trackName = trackName & " (" & Left(TrackFeaturing, tmp-1) & " & " & Mid(TrackFeaturing, tmp+Len(ArtistSeparator)) & ")"
- End If
- Else
- tmp = InStrRev(TrackFeaturing, ArtistSeparator)
- If tmp = 0 Or ArtistLastSeparator = False Then
- If Left(TrackFeaturing, 1) = "," Or Left(TrackFeaturing, 1) = ";" Then
- artistList = artistList & TrackFeaturing
- Else
- artistList = artistList & " " & TrackFeaturing
- End If
- Else
- artistList = artistList & " " & Left(TrackFeaturing, tmp-1) & " & " & Mid(TrackFeaturing, tmp+Len(ArtistSeparator))
- End If
- End If
- End If
- ArtistTitles.Add artistList
- TrackLyricists = FindArtist(TrackLyricists, AlbumLyricist)
- If AlbumLyricist <> "" and TrackLyricists <> "" Then
- Lyricists.Add AlbumLyricist & Separator & TrackLyricists
- Else
- Lyricists.Add AlbumLyricist & TrackLyricists
- End If
- TrackComposers = FindArtist(TrackComposers, AlbumComposer)
- If AlbumComposer <> "" and TrackComposers <> "" Then
- Composers.Add AlbumComposer & Separator & TrackComposers
- Else
- Composers.Add AlbumComposer & TrackComposers
- End If
- TrackConductors = FindArtist(TrackConductors, AlbumConductor)
- If AlbumConductor <> "" and TrackConductors <> "" Then
- Conductors.Add AlbumConductor & Separator & TrackConductors
- Else
- Conductors.Add AlbumConductor & TrackConductors
- End If
- TrackProducers = FindArtist(TrackProducers, AlbumProducer)
- If AlbumProducer <> "" and TrackProducers <> "" Then
- Producers.Add AlbumProducer & Separator & TrackProducers
- Else
- Producers.Add AlbumProducer & TrackProducers
- End If
- If UBound(Involved_R_T) > 0 Then
- For tmp = 1 To UBound(involved_R_T)
- TrackInvolvedPeople = TrackInvolvedPeople & Involved_R_T(tmp) & Separator
- Next
- TrackInvolvedPeople = Left(TrackInvolvedPeople, Len(TrackInvolvedPeople)- Len(Separator))
- Else
- TrackInvolvedPeople = ""
- End If
- InvolvedArtists.Add TrackInvolvedPeople
- Tracks.Add trackName
- iTrackNum = iTrackNum + 1
- Next
- Next
- ' Get album title
- AlbumTitle = PackSpaces(currentRelease("title"), False)
- Dim json
- Set json = New VbsJson
- ' Get Album art URL
- WriteLog " "
- WriteLog "Search for cover"
- If CurrentRelease.Exists("cover-art-archive") Then
- WriteLog CurrentRelease("cover-art-archive")("count") & " Images on CoverArtArchive found"
- If CurrentRelease("cover-art-archive")("count") > 0 And CurrentRelease("cover-art-archive")("front") = True Then
- searchURL = "http://coverartarchive.org/release/" & CurrentReleaseId
- WriteLog searchURL
- Set oXMLHTTP = CreateObject("MSXML2.ServerXMLHTTP.6.0")
- oXMLHTTP.Open "GET", searchURL, False
- oXMLHTTP.setRequestHeader "Content-Type", "application/json"
- oXMLHTTP.setRequestHeader "User-Agent",UserAgent
- oXMLHTTP.send ()
- If oXMLHTTP.Status = 200 Then
- Set currentImage = json.Decode(oXMLHTTP.responseText)
- For Each image In currentImage("images")
- Set tmp = currentImage("images")(image)
- If tmp("front") = True Then
- AlbumArtURL = tmp("image")
- AlbumArtThumbNail = tmp("thumbnails")("small")
- Exit For
- End If
- Next
- End If
- End If
- End If
- '----------------------------------CoverArtArchive Images----------------------------------------
- Set ImageList = SDB.NewStringList
- Set SaveImageType = SDB.NewStringList
- Set SaveImage = SDB.NewStringList
- ImagesCount = 0
- If CurrentRelease.Exists("cover-art-archive") And CurrentRelease("cover-art-archive")("count") <> "" Then
- If CurrentRelease("cover-art-archive")("count") > 1 Then
- searchURL = "http://coverartarchive.org/release/" & CurrentRelease("id")
- WriteLog searchURL
- ImagesCount = CurrentRelease("cover-art-archive")("count")
- Set oXMLHTTP = CreateObject("MSXML2.ServerXMLHTTP.6.0")
- oXMLHTTP.Open "GET", searchURL, False
- oXMLHTTP.setRequestHeader "Content-Type", "application/json"
- oXMLHTTP.setRequestHeader "User-Agent",UserAgent
- oXMLHTTP.send ()
- If oXMLHTTP.Status = 200 Then
- Set currentImage = json.Decode(oXMLHTTP.responseText)
- For Each image In currentImage("images")
- Set tmp = currentImage("images")(image)
- If tmp("image") <> AlbumArtURL Then
- ImageList.add tmp("thumbnails")("small")
- SaveImageType.add "other"
- SaveImage.add "0"
- End If
- Next
- End If
- End If
- End If
- '----------------------------------CoverArtArchive Images----------------------------------------
- ' Get release year/date
- If CurrentRelease.Exists("date") And CurrentRelease("date") <> "" Then
- ReleaseDate = CurrentRelease("date")
- If Len(ReleaseDate) = 10 Then
- ReleaseSplit = Split(ReleaseDate,"-")
- ReleaseDate = ReleaseSplit(2) & "-" & ReleaseSplit(1) & "-" & ReleaseSplit(0)
- ElseIf Len(ReleaseDate) = 7 Then
- ReleaseSplit = Split(ReleaseDate,"-")
- ReleaseDate = "00-" & ReleaseSplit(1) & "-" & ReleaseSplit(0)
- End If
- If CheckYearOnlyDate Then
- ReleaseDate = Right(ReleaseDate, 4)
- End If
- Else
- ReleaseDate = ""
- End If
- WriteLog "ReleaseDate=" & ReleaseDate
- 'Set OriginalDate
- set tmp = CurrentRelease("release-group")
- If tmp.Exists("first-release-date") And CurrentRelease("release-group")("first-release-date") <> "" Then
- OriginalDate = CurrentRelease("release-group")("first-release-date")
- If Len(OriginalDate) = 10 Then
- ReleaseSplit = Split(OriginalDate,"-")
- OriginalDate = ReleaseSplit(2) & "-" & ReleaseSplit(1) & "-" & ReleaseSplit(0)
- ElseIf Len(OriginalDate) = 7 Then
- ReleaseSplit = Split(OriginalDate,"-")
- OriginalDate = "00-" & ReleaseSplit(1) & "-" & ReleaseSplit(0)
- End If
- If CheckYearOnlyDate Then
- OriginalDate = Right(OriginalDate, 4)
- End If
- Else
- OriginalDate = ""
- End If
- WriteLog "OriginalDate=" & OriginalDate
- ' Get Label
- If CurrentRelease.Exists("label-info") Then
- For Each l In CurrentRelease("label-info")
- Set currentLabel = CurrentRelease("label-info")(l)
- If SavedLabelID = "" And Not IsNull(currentLabel("label")) Then
- set tmp = currentLabel("label")
- If tmp.Exists("id") Then
- SavedLabelID = tmp("id")
- End If
- If Not IsNull(currentLabel("label")("name")) Then
- AddToField theLabels, CleanArtistName(currentLabel("label")("name"))
- End If
- End If
- If IsNull(currentLabel("catalog-number")) Then
- theCatalogs = ""
- Else
- AddToField theCatalogs, currentLabel("catalog-number")
- End If
- Next
- Else
- theLabels = ""
- theCatalogs = ""
- End If
- WriteLog "theLabels=" & theLabels
- WriteLog "theCatalogs=" & theCatalogs
- ' Get Country
- If CurrentRelease.Exists("country") And CurrentRelease("country") <> "" Then
- theCountry = CurrentRelease("country")
- For f = 1 To CountryCode.Count
- If theCountry = CountryCode.Item(f) Then
- theCountry = CountryList.Item(f)
- Exit For
- End If
- Next
- Else
- theCountry = ""
- End If
- WriteLog "country=" & theCountry
- ' Get Format
- If CurrentRelease.Exists("media") Then
- For Each f In CurrentRelease("media")
- Set currentFormat = CurrentRelease("media")(f)
- If currentFormat("format") <> "" And theFormat <> currentFormat("format") Then
- AddToField theFormat, currentFormat("format")
- End If
- Next
- WriteLog "theformat=" & theformat
- End If
- tmp = ""
- If CurrentRelease.Exists("release-group") Then
- tmp = CurrentRelease("release-group")("primary-type")
- If theFormat <> "" Then
- theFormat = theFormat & FormatSeparator & tmp
- Else
- theFormat = tmp
- End If
- Set tmp = CurrentRelease("release-group")
- If tmp.Exists("secondary-types") Then
- For Each f In tmp("secondary-types")
- If CurrentRelease("release-group")("secondary-types")(f) <> "" Then
- theFormat = theFormat & FormatSeparator & CurrentRelease("release-group")("secondary-types")(f)
- End If
- Next
- End If
- End If
- WriteLog "theformat=" & theFormat
- End If
- End If
- FormatSearchResultsViewer Tracks, TracksNum, TracksCD, Durations, AlbumArtist, AlbumArtistTitle, ArtistTitles, AlbumTitle, ReleaseDate, OriginalDate, GenresList, theLabels, theCountry, AlbumArtThumbNail, CurrentReleaseId, theCatalogs, Lyricists, Composers, Conductors, Producers, InvolvedArtists, theFormat, theMaster, comment, DiscogsTracksNum, DataQuality, Grouping
- Dim SelectedTracks, j, k, SelTracksCount, StartCount
- Set SelectedTracks = SDB.NewStringList
- Set SelectedSongsGlobal = SDB.NewSongList
- 'Tracks = Stringliste mit den Songnamen
- WriteLog "-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+"
- WriteLog "DiffNumberTracks=" & DiffNumberTracks
- If CheckNewMatchingEngine = False Then
- For i = 0 To Tracks.Count - 1
- If UnselectedTracks(i) = "" Then
- If UnselectedTrackNames(i) = "" Then
- SelectedTracks.Add Tracks.Item(i)
- Else
- If SDB.Tools.WebSearch.NewTracks.Count - 1 < i Then
- SelectedTracks.Add Tracks.Item(i)
- Else
- SelectedTracks.Add SDB.Tools.WebSearch.NewTracks.Item(i).Title
- End If
- End If
- End If
- Next
- For i = 0 To SDB.Tools.WebSearch.NewTracks.Count -1
- SelectedSongsGlobal.Add SDB.Tools.WebSearch.NewTracks.Item(i)
- Next
- SDB.Tools.WebSearch.SmartUpdateTracks SelectedTracks
- For i = 0 To SDB.Tools.WebSearch.NewTracks.Count - 1
- If CheckArtist Then SDB.Tools.WebSearch.NewTracks.Item(i).ArtistName = AlbumArtistTitle
- For j = 0 To Tracks.Count - 1
- If Tracks.Item(j) = SDB.Tools.WebSearch.NewTracks.Item(i).Title Then
- If UnselectedTracks(j) = "" Then
- If UnselectedTrackNames(j) = "" Then
- SDB.Tools.WebSearch.NewTracks.Item(i).Title = Tracks.Item(j)
- Else
- SDB.Tools.WebSearch.NewTracks.Item(i).Title = SDB.Tools.WebSearch.NewTracks.Item(i).Title
- End If
- If CheckArtist And ((CheckDontFillEmptyFields = True And ArtistTitles.Item(j) <> "") Or CheckDontFillEmptyFields = False) Then SDB.Tools.WebSearch.NewTracks.Item(i).ArtistName = ArtistTitles.Item(j)
- If CheckTrackNum And ((CheckDontFillEmptyFields = True And TracksNum.Item(j) <> "") Or CheckDontFillEmptyFields = False) Then SDB.Tools.WebSearch.NewTracks.Item(i).TrackOrderStr = TracksNum.Item(j)
- If CheckDiscNum And ((CheckDontFillEmptyFields = True And TracksCD.Item(j) <> "") Or CheckDontFillEmptyFields = False) Then SDB.Tools.WebSearch.NewTracks.Item(i).DiscNumberStr = TracksCD.Item(j)
- If CheckInvolved And ((CheckDontFillEmptyFields = True And InvolvedArtists.Item(j) <> "") Or CheckDontFillEmptyFields = False) Then SDB.Tools.WebSearch.NewTracks.Item(i).InvolvedPeople = InvolvedArtists.Item(j)
- If CheckGrouping And ((CheckDontFillEmptyFields = True And Grouping(j) <> "") Or CheckDontFillEmptyFields = False) Then SDB.Tools.WebSearch.NewTracks.Item(i).Grouping = Grouping(j)
- If CheckLyricist And ((CheckDontFillEmptyFields = True And Lyricists.Item(j) <> "") Or CheckDontFillEmptyFields = False) Then SDB.Tools.WebSearch.NewTracks.Item(i).Lyricist = Lyricists.Item(j)
- If CheckComposer And ((CheckDontFillEmptyFields = True And Composers.Item(j) <> "") Or CheckDontFillEmptyFields = False) Then SDB.Tools.WebSearch.NewTracks.Item(i).Author = Composers.Item(j)
- If CheckConductor And ((CheckDontFillEmptyFields = True And Conductors.Item(j) <> "") Or CheckDontFillEmptyFields = False) Then SDB.Tools.WebSearch.NewTracks.Item(i).Conductor = Conductors.Item(j)
- If CheckProducer And ((CheckDontFillEmptyFields = True And Producers.Item(j) <> "") Or CheckDontFillEmptyFields = False) Then SDB.Tools.WebSearch.NewTracks.Item(i).Producer = Producers.Item(j)
- End If
- End If
- Next
- If CheckAlbumArtist And ((CheckDontFillEmptyFields = True And AlbumArtist <> "") Or CheckDontFillEmptyFields = False) Then SDB.Tools.WebSearch.NewTracks.Item(i).AlbumArtistName = AlbumArtist
- If CheckAlbum And ((CheckDontFillEmptyFields = True And AlbumTitle <> "") Or CheckDontFillEmptyFields = False) Then SDB.Tools.WebSearch.NewTracks.Item(i).AlbumName = AlbumTitle
- If CheckDate Then
- If Len(ReleaseDate) > 4 Then
- SDB.Tools.WebSearch.NewTracks.Item(i).Year = Mid(ReleaseDate,7,4)
- SDB.Tools.WebSearch.NewTracks.Item(i).Month = Mid(ReleaseDate,4,2)
- SDB.Tools.WebSearch.NewTracks.Item(i).Day = Mid(ReleaseDate,1,2)
- ElseIf IsNumeric(ReleaseDate) Then
- SDB.Tools.WebSearch.NewTracks.Item(i).Year = ReleaseDate
- ElseIf ReleaseDate = "" Then
- If CheckDontFillEmptyFields = False Then
- SDB.Tools.WebSearch.NewTracks.Item(i).Year = -1
- End If
- End If
- End If
- If CheckOrigDate Then
- If Len(OriginalDate) > 4 Then
- SDB.Tools.WebSearch.NewTracks.Item(i).OriginalYear = Mid(OriginalDate,7,4)
- SDB.Tools.WebSearch.NewTracks.Item(i).OriginalMonth = Mid(OriginalDate,4,2)
- SDB.Tools.WebSearch.NewTracks.Item(i).OriginalDay = Mid(OriginalDate,1,2)
- ElseIf IsNumeric(OriginalDate) Then
- SDB.Tools.WebSearch.NewTracks.Item(i).OriginalYear = OriginalDate
- ElseIf OriginalDate = "" Then
- If CheckDontFillEmptyFields = False Then
- SDB.Tools.WebSearch.NewTracks.Item(i).OriginalYear = -1
- End If
- End If
- End If
- If CheckStyleField = "Default (stored with Genre)" Then
- If CheckGenre Then
- If Not(NewGenre = "" And CheckDontFillEmptyFields = True) Then
- SDB.Tools.WebSearch.NewTracks.Item(i).Genre = NewGenre
- End If
- End If
- End If
- If CheckLabel And ((CheckDontFillEmptyFields = True And theLabels <> "") Or CheckDontFillEmptyFields = False) Then SDB.Tools.WebSearch.NewTracks.Item(i).Publisher = theLabels
- If CheckComment And ((CheckDontFillEmptyFields = True And comment <> "") Or CheckDontFillEmptyFields = False) Then SDB.Tools.WebSearch.NewTracks.Item(i).Comment = comment
- If CheckRelease And ((CheckDontFillEmptyFields = True And CurrentReleaseId <> "") Or CheckDontFillEmptyFields = False) Then
- If ReleaseTag = "Custom1" Then SDB.Tools.WebSearch.NewTracks.Item(i).Custom1 = CurrentReleaseId
- If ReleaseTag = "Custom2" Then SDB.Tools.WebSearch.NewTracks.Item(i).Custom2 = CurrentReleaseId
- If ReleaseTag = "Custom3" Then SDB.Tools.WebSearch.NewTracks.Item(i).Custom3 = CurrentReleaseId
- If ReleaseTag = "Custom4" Then SDB.Tools.WebSearch.NewTracks.Item(i).Custom4 = CurrentReleaseId
- If ReleaseTag = "Custom5" Then SDB.Tools.WebSearch.NewTracks.Item(i).Custom5 = CurrentReleaseId
- If ReleaseTag = "Grouping" Then SDB.Tools.WebSearch.NewTracks.Item(i).Grouping = CurrentReleaseId
- If ReleaseTag = "ISRC" Then SDB.Tools.WebSearch.NewTracks.Item(i).ISRC = CurrentReleaseId
- If ReleaseTag = "Encoder" Then SDB.Tools.WebSearch.NewTracks.Item(i).Encoder = CurrentReleaseId
- If ReleaseTag = "Copyright" Then SDB.Tools.WebSearch.NewTracks.Item(i).Copyright = CurrentReleaseId
- End If
- If CheckCatalog And ((CheckDontFillEmptyFields = True And theCatalogs <> "") Or CheckDontFillEmptyFields = False) Then
- If CatalogTag = "Custom1" Then SDB.Tools.WebSearch.NewTracks.Item(i).Custom1 = theCatalogs
- If CatalogTag = "Custom2" Then SDB.Tools.WebSearch.NewTracks.Item(i).Custom2 = theCatalogs
- If CatalogTag = "Custom3" Then SDB.Tools.WebSearch.NewTracks.Item(i).Custom3 = theCatalogs
- If CatalogTag = "Custom4" Then SDB.Tools.WebSearch.NewTracks.Item(i).Custom4 = theCatalogs
- If CatalogTag = "Custom5" Then SDB.Tools.WebSearch.NewTracks.Item(i).Custom5 = theCatalogs
- If CatalogTag = "ISRC" Then SDB.Tools.WebSearch.NewTracks.Item(i).ISRC = theCatalogs
- End If
- If CheckCountry And ((CheckDontFillEmptyFields = True And theCountry <> "") Or CheckDontFillEmptyFields = False) Then
- If CountryTag = "Custom1" Then SDB.Tools.WebSearch.NewTracks.Item(i).Custom1 = theCountry
- If CountryTag = "Custom2" Then SDB.Tools.WebSearch.NewTracks.Item(i).Custom2 = theCountry
- If CountryTag = "Custom3" Then SDB.Tools.WebSearch.NewTracks.Item(i).Custom3 = theCountry
- If CountryTag = "Custom4" Then SDB.Tools.WebSearch.NewTracks.Item(i).Custom4 = theCountry
- If CountryTag = "Custom5" Then SDB.Tools.WebSearch.NewTracks.Item(i).Custom5 = theCountry
- End If
- If CheckFormat And ((CheckDontFillEmptyFields = True And theFormat <> "") Or CheckDontFillEmptyFields = False) Then
- If FormatTag = "Custom1" Then SDB.Tools.WebSearch.NewTracks.Item(i).Custom1 = theFormat
- If FormatTag = "Custom2" Then SDB.Tools.WebSearch.NewTracks.Item(i).Custom2 = theFormat
- If FormatTag = "Custom3" Then SDB.Tools.WebSearch.NewTracks.Item(i).Custom3 = theFormat
- If FormatTag = "Custom4" Then SDB.Tools.WebSearch.NewTracks.Item(i).Custom4 = theFormat
- If FormatTag = "Custom5" Then SDB.Tools.WebSearch.NewTracks.Item(i).Custom5 = theFormat
- End If
- Next
- Else
- If SDB.Tools.WebSearch.NewTracks.Count = 1 Then
- WriteLog "Only one track for tagging selected"
- SelectedTracks.Add SDB.Tools.WebSearch.NewTracks.Item(0).Title
- SDB.Tools.WebSearch.SmartUpdateTracks SelectedTracks
- For i = 0 To SDB.Tools.WebSearch.NewTracks.Count - 1
- SelectedSongsGlobal.Add SDB.Tools.WebSearch.NewTracks.Item(i)
- Next
- i = 0
- For j = 0 To Tracks.Count - 1
- If Tracks.Item(j) = SDB.Tools.WebSearch.NewTracks.Item(i).Title Then
- If UnselectedTracks(j) = "" Then
- If UnselectedTrackNames(j) = "" Then
- SDB.Tools.WebSearch.NewTracks.Item(i).Title = Tracks.Item(j)
- Else
- SDB.Tools.WebSearch.NewTracks.Item(i).Title = SDB.Tools.WebSearch.NewTracks.Item(i).Title
- End If
- If CheckArtist And ((CheckDontFillEmptyFields = True And ArtistTitles.Item(j) <> "") Or CheckDontFillEmptyFields = False) Then SDB.Tools.WebSearch.NewTracks.Item(i).ArtistName = ArtistTitles.Item(j)
- If CheckTrackNum And ((CheckDontFillEmptyFields = True And TracksNum.Item(j) <> "") Or CheckDontFillEmptyFields = False) Then SDB.Tools.WebSearch.NewTracks.Item(i).TrackOrderStr = TracksNum.Item(j)
- If CheckDiscNum And ((CheckDontFillEmptyFields = True And TracksCD.Item(j) <> "") Or CheckDontFillEmptyFields = False) Then SDB.Tools.WebSearch.NewTracks.Item(i).DiscNumberStr = TracksCD.Item(j)
- If CheckInvolved And ((CheckDontFillEmptyFields = True And InvolvedArtists.Item(j) <> "") Or CheckDontFillEmptyFields = False) Then SDB.Tools.WebSearch.NewTracks.Item(i).InvolvedPeople = InvolvedArtists.Item(j)
- If CheckGrouping And ((CheckDontFillEmptyFields = True And Grouping(j) <> "") Or CheckDontFillEmptyFields = False) Then SDB.Tools.WebSearch.NewTracks.Item(i).Grouping = Grouping(j)
- If CheckLyricist And ((CheckDontFillEmptyFields = True And Lyricists.Item(j) <> "") Or CheckDontFillEmptyFields = False) Then SDB.Tools.WebSearch.NewTracks.Item(i).Lyricist = Lyricists.Item(j)
- If CheckComposer And ((CheckDontFillEmptyFields = True And Composers.Item(j) <> "") Or CheckDontFillEmptyFields = False) Then SDB.Tools.WebSearch.NewTracks.Item(i).Author = Composers.Item(j)
- If CheckConductor And ((CheckDontFillEmptyFields = True And Conductors.Item(j) <> "") Or CheckDontFillEmptyFields = False) Then SDB.Tools.WebSearch.NewTracks.Item(i).Conductor = Conductors.Item(j)
- If CheckProducer And ((CheckDontFillEmptyFields = True And Producers.Item(j) <> "") Or CheckDontFillEmptyFields = False) Then SDB.Tools.WebSearch.NewTracks.Item(i).Producer = Producers.Item(j)
- Exit For
- End If
- End If
- Next
- If CheckAlbumArtist And ((CheckDontFillEmptyFields = True And AlbumArtist <> "") Or CheckDontFillEmptyFields = False) Then SDB.Tools.WebSearch.NewTracks.Item(i).AlbumArtistName = AlbumArtist
- If CheckAlbum And ((CheckDontFillEmptyFields = True And AlbumTitle <> "") Or CheckDontFillEmptyFields = False) Then SDB.Tools.WebSearch.NewTracks.Item(i).AlbumName = AlbumTitle
- If CheckDate Then
- If Len(ReleaseDate) > 4 Then
- If QueryPage = "MetalArchives" Then
- ReleaseDate = convert_date(ReleaseDate)
- End If
- SDB.Tools.WebSearch.NewTracks.Item(i).Year = Mid(ReleaseDate,7,4)
- SDB.Tools.WebSearch.NewTracks.Item(i).Month = Mid(ReleaseDate,4,2)
- SDB.Tools.WebSearch.NewTracks.Item(i).Day = Mid(ReleaseDate,1,2)
- ElseIf IsNumeric(ReleaseDate) Then
- SDB.Tools.WebSearch.NewTracks.Item(i).Year = ReleaseDate
- ElseIf ReleaseDate = "" Then
- If CheckDontFillEmptyFields = False Then
- SDB.Tools.WebSearch.NewTracks.Item(i).Year = -1
- End If
- End If
- End If
- If CheckOrigDate And QueryPage <> "MetalArchives" Then
- If Len(OriginalDate) > 4 Then
- SDB.Tools.WebSearch.NewTracks.Item(i).OriginalYear = Mid(OriginalDate,7,4)
- SDB.Tools.WebSearch.NewTracks.Item(i).OriginalMonth = Mid(OriginalDate,4,2)
- SDB.Tools.WebSearch.NewTracks.Item(i).OriginalDay = Mid(OriginalDate,1,2)
- ElseIf IsNumeric(OriginalDate) Then
- SDB.Tools.WebSearch.NewTracks.Item(i).OriginalYear = OriginalDate
- ElseIf OriginalDate = "" Then
- If CheckDontFillEmptyFields = False Then
- SDB.Tools.WebSearch.NewTracks.Item(i).OriginalYear = -1
- End If
- End If
- End If
- If CheckStyleField = "Default (stored with Genre)" Then
- If CheckGenre Then
- If Not(NewGenre = "" And CheckDontFillEmptyFields = True) Then
- SDB.Tools.WebSearch.NewTracks.Item(i).Genre = NewGenre
- End If
- End If
- End If
- If CheckLabel And ((CheckDontFillEmptyFields = True And theLabels <> "") Or CheckDontFillEmptyFields = False) Then SDB.Tools.WebSearch.NewTracks.Item(i).Publisher = theLabels
- If CheckComment And ((CheckDontFillEmptyFields = True And comment <> "") Or CheckDontFillEmptyFields = False) Then SDB.Tools.WebSearch.NewTracks.Item(i).Comment = comment
- If CheckRelease And ((CheckDontFillEmptyFields = True And CurrentReleaseId <> "") Or CheckDontFillEmptyFields = False) Then
- If ReleaseTag = "Custom1" Then SDB.Tools.WebSearch.NewTracks.Item(i).Custom1 = CurrentReleaseId
- If ReleaseTag = "Custom2" Then SDB.Tools.WebSearch.NewTracks.Item(i).Custom2 = CurrentReleaseId
- If ReleaseTag = "Custom3" Then SDB.Tools.WebSearch.NewTracks.Item(i).Custom3 = CurrentReleaseId
- If ReleaseTag = "Custom4" Then SDB.Tools.WebSearch.NewTracks.Item(i).Custom4 = CurrentReleaseId
- If ReleaseTag = "Custom5" Then SDB.Tools.WebSearch.NewTracks.Item(i).Custom5 = CurrentReleaseId
- If ReleaseTag = "Grouping" Then SDB.Tools.WebSearch.NewTracks.Item(i).Grouping = CurrentReleaseId
- If ReleaseTag = "ISRC" Then SDB.Tools.WebSearch.NewTracks.Item(i).ISRC = CurrentReleaseId
- If ReleaseTag = "Encoder" Then SDB.Tools.WebSearch.NewTracks.Item(i).Encoder = CurrentReleaseId
- If ReleaseTag = "Copyright" Then SDB.Tools.WebSearch.NewTracks.Item(i).Copyright = CurrentReleaseId
- End If
- If CheckCatalog And ((CheckDontFillEmptyFields = True And theCatalogs <> "") Or CheckDontFillEmptyFields = False) Then
- If CatalogTag = "Custom1" Then SDB.Tools.WebSearch.NewTracks.Item(i).Custom1 = theCatalogs
- If CatalogTag = "Custom2" Then SDB.Tools.WebSearch.NewTracks.Item(i).Custom2 = theCatalogs
- If CatalogTag = "Custom3" Then SDB.Tools.WebSearch.NewTracks.Item(i).Custom3 = theCatalogs
- If CatalogTag = "Custom4" Then SDB.Tools.WebSearch.NewTracks.Item(i).Custom4 = theCatalogs
- If CatalogTag = "Custom5" Then SDB.Tools.WebSearch.NewTracks.Item(i).Custom5 = theCatalogs
- If CatalogTag = "ISRC" Then SDB.Tools.WebSearch.NewTracks.Item(i).ISRC = theCatalogs
- End If
- If CheckCountry And ((CheckDontFillEmptyFields = True And theCountry <> "") Or CheckDontFillEmptyFields = False) Then
- If CountryTag = "Custom1" Then SDB.Tools.WebSearch.NewTracks.Item(i).Custom1 = theCountry
- If CountryTag = "Custom2" Then SDB.Tools.WebSearch.NewTracks.Item(i).Custom2 = theCountry
- If CountryTag = "Custom3" Then SDB.Tools.WebSearch.NewTracks.Item(i).Custom3 = theCountry
- If CountryTag = "Custom4" Then SDB.Tools.WebSearch.NewTracks.Item(i).Custom4 = theCountry
- If CountryTag = "Custom5" Then SDB.Tools.WebSearch.NewTracks.Item(i).Custom5 = theCountry
- End If
- If CheckFormat And ((CheckDontFillEmptyFields = True And theFormat <> "") Or CheckDontFillEmptyFields = False) Then
- If FormatTag = "Custom1" Then SDB.Tools.WebSearch.NewTracks.Item(i).Custom1 = theFormat
- If FormatTag = "Custom2" Then SDB.Tools.WebSearch.NewTracks.Item(i).Custom2 = theFormat
- If FormatTag = "Custom3" Then SDB.Tools.WebSearch.NewTracks.Item(i).Custom3 = theFormat
- If FormatTag = "Custom4" Then SDB.Tools.WebSearch.NewTracks.Item(i).Custom4 = theFormat
- If FormatTag = "Custom5" Then SDB.Tools.WebSearch.NewTracks.Item(i).Custom5 = theFormat
- End If
- Else
- WriteLog SDB.Tools.WebSearch.NewTracks.Count & " tracks for tagging selected"
- For i = 0 To SDB.Tools.WebSearch.NewTracks.Count - 1
- WriteLog "SDB.Tools.WebSearch.NewTracks.Item(i).Title=" & SDB.Tools.WebSearch.NewTracks.Item(i).Title
- Next
- WriteLog ""
- For i = 0 To Tracks.Count - 1
- WriteLog "Tracks.Item(i)=" & Tracks.Item(i)
- Next
- WriteLog ""
- SelTracksCount = 0
- For i = 0 To Tracks.Count - 1
- If UnselectedTracks(i) = "" Then
- If UnselectedTrackNames(i) = "" Then
- SelTracksCount = SelTracksCount + 1
- Else
- SelTracksCount = SelTracksCount + 1
- End If
- If SDB.Tools.WebSearch.NewTracks.Count = SelTracksCount Then
- Exit For
- End If
- End If
- Next
- StartCount = 0
- If SelTracksCount < SDB.Tools.WebSearch.NewTracks.Count Then
- StartCount = SDB.Tools.WebSearch.NewTracks.Count - SelTracksCount
- End If
- WriteLog "StartCount=" & StartCount
- SelTracksCount = 0
- For i = 0 To Tracks.Count - 1
- If UnselectedTracks(i) = "" Then
- If UnselectedTrackNames(i) = "" Then
- SelectedTracks.Add Tracks.Item(i)
- SelTracksCount = SelTracksCount + 1
- StartCount = StartCount + 1
- Else
- SelectedTracks.Add SDB.Tools.WebSearch.NewTracks.Item(StartCount).Title
- SelTracksCount = SelTracksCount + 1
- StartCount = StartCount + 1
- WriteLog "SelTracksCount=" & SelTracksCount
- WriteLog "SDB.Tools.WebSearch.NewTracks.Count=" & SDB.Tools.WebSearch.NewTracks.Count
- End If
- If SDB.Tools.WebSearch.NewTracks.Count = SelTracksCount Then
- Exit For
- End If
- End If
- Next
- For i = 0 To SDB.Tools.WebSearch.NewTracks.Count - 1
- SelectedSongsGlobal.Add SDB.Tools.WebSearch.NewTracks.Item(i)
- Next
- For i = 0 to SelTracksCount-1
- WriteLog "SelectedTracks=" & SelectedTracks.Item(i)
- Next
- SDB.Tools.WebSearch.SmartUpdateTracks SelectedTracks
- StartCount = 0
- If SelTracksCount < SDB.Tools.WebSearch.NewTracks.Count Then
- StartCount = SDB.Tools.WebSearch.NewTracks.Count - SelTracksCount
- End If
- WriteLog "StartCount=" & StartCount
- SelTracksCount = 0
- For i = StartCount To SDB.Tools.WebSearch.NewTracks.Count - 1
- For j = SelTracksCount To Tracks.Count - 1
- WriteLog "SelTracksCount=" & SelTracksCount
- WriteLog "j=" & j
- If UnselectedTracks(j) = "" Then
- If UnselectedTrackNames(j) = "" Then
- WriteLog "SDB.Tools.WebSearch.NewTracks.Item(i).Title=" & SDB.Tools.WebSearch.NewTracks.Item(i).Title
- SDB.Tools.WebSearch.NewTracks.Item(i).Title = Tracks.Item(j)
- WriteLog "Tracks.Item(j)=" & Tracks.Item(j) & " - j=" & j
- Else
- WriteLog "Trackname nicht gewählt=" & SDB.Tools.WebSearch.NewTracks.Item(i).Title
- SDB.Tools.WebSearch.NewTracks.Item(i).Title = SDB.Tools.WebSearch.NewTracks.Item(i).Title
- End If
- If CheckArtist And ((CheckDontFillEmptyFields = True And ArtistTitles.Item(j) <> "") Or CheckDontFillEmptyFields = False) Then SDB.Tools.WebSearch.NewTracks.Item(i).ArtistName = ArtistTitles.Item(j)
- If CheckTrackNum And ((CheckDontFillEmptyFields = True And TracksNum.Item(j) <> "") Or CheckDontFillEmptyFields = False) Then SDB.Tools.WebSearch.NewTracks.Item(i).TrackOrderStr = TracksNum.Item(j)
- If CheckDiscNum And ((CheckDontFillEmptyFields = True And TracksCD.Item(j) <> "") Or CheckDontFillEmptyFields = False) Then SDB.Tools.WebSearch.NewTracks.Item(i).DiscNumberStr = TracksCD.Item(j)
- If CheckInvolved And ((CheckDontFillEmptyFields = True And InvolvedArtists.Item(j) <> "") Or CheckDontFillEmptyFields = False) Then SDB.Tools.WebSearch.NewTracks.Item(i).InvolvedPeople = InvolvedArtists.Item(j)
- If CheckGrouping And ((CheckDontFillEmptyFields = True And Grouping(j) <> "") Or CheckDontFillEmptyFields = False) Then SDB.Tools.WebSearch.NewTracks.Item(i).Grouping = Grouping(j)
- If CheckLyricist And ((CheckDontFillEmptyFields = True And Lyricists.Item(j) <> "") Or CheckDontFillEmptyFields = False) Then SDB.Tools.WebSearch.NewTracks.Item(i).Lyricist = Lyricists.Item(j)
- If CheckComposer And ((CheckDontFillEmptyFields = True And Composers.Item(j) <> "") Or CheckDontFillEmptyFields = False) Then SDB.Tools.WebSearch.NewTracks.Item(i).Author = Composers.Item(j)
- If CheckConductor And ((CheckDontFillEmptyFields = True And Conductors.Item(j) <> "") Or CheckDontFillEmptyFields = False) Then SDB.Tools.WebSearch.NewTracks.Item(i).Conductor = Conductors.Item(j)
- If CheckProducer And ((CheckDontFillEmptyFields = True And Producers.Item(j) <> "") Or CheckDontFillEmptyFields = False) Then SDB.Tools.WebSearch.NewTracks.Item(i).Producer = Producers.Item(j)
- SelTracksCount = SelTracksCount + 1
- Exit For
- End If
- SelTracksCount = SelTracksCount + 1
- Next
- If CheckAlbumArtist And ((CheckDontFillEmptyFields = True And AlbumArtist <> "") Or CheckDontFillEmptyFields = False) Then SDB.Tools.WebSearch.NewTracks.Item(i).AlbumArtistName = AlbumArtist
- If CheckAlbum And ((CheckDontFillEmptyFields = True And AlbumTitle <> "") Or CheckDontFillEmptyFields = False) Then SDB.Tools.WebSearch.NewTracks.Item(i).AlbumName = AlbumTitle
- If CheckDate Then
- If Len(ReleaseDate) > 4 Then
- If QueryPage = "MetalArchives" Then
- ReleaseDate = convert_date(ReleaseDate)
- End If
- SDB.Tools.WebSearch.NewTracks.Item(i).Year = Mid(ReleaseDate,7,4)
- SDB.Tools.WebSearch.NewTracks.Item(i).Month = Mid(ReleaseDate,4,2)
- SDB.Tools.WebSearch.NewTracks.Item(i).Day = Mid(ReleaseDate,1,2)
- ElseIf IsNumeric(ReleaseDate) Then
- SDB.Tools.WebSearch.NewTracks.Item(i).Year = ReleaseDate
- ElseIf ReleaseDate = "" Then
- If CheckDontFillEmptyFields = False Then
- SDB.Tools.WebSearch.NewTracks.Item(i).Year = -1
- End If
- End If
- End If
- If CheckOrigDate And QueryPage <> "MetalArchives" Then
- If Len(OriginalDate) > 4 Then
- SDB.Tools.WebSearch.NewTracks.Item(i).OriginalYear = Mid(OriginalDate,7,4)
- SDB.Tools.WebSearch.NewTracks.Item(i).OriginalMonth = Mid(OriginalDate,4,2)
- SDB.Tools.WebSearch.NewTracks.Item(i).OriginalDay = Mid(OriginalDate,1,2)
- ElseIf IsNumeric(OriginalDate) Then
- SDB.Tools.WebSearch.NewTracks.Item(i).OriginalYear = OriginalDate
- ElseIf OriginalDate = "" Then
- If CheckDontFillEmptyFields = False Then
- SDB.Tools.WebSearch.NewTracks.Item(i).OriginalYear = -1
- End If
- End If
- End If
- If CheckStyleField = "Default (stored with Genre)" Then
- If CheckGenre And QueryPage <> "MetalArchives" Then
- If Not(NewGenre = "" And CheckDontFillEmptyFields = True) Then
- SDB.Tools.WebSearch.NewTracks.Item(i).Genre = NewGenre
- End If
- End If
- End If
- If CheckLabel And ((CheckDontFillEmptyFields = True And theLabels <> "") Or CheckDontFillEmptyFields = False) Then SDB.Tools.WebSearch.NewTracks.Item(i).Publisher = theLabels
- If CheckComment And ((CheckDontFillEmptyFields = True And comment <> "") Or CheckDontFillEmptyFields = False) Then SDB.Tools.WebSearch.NewTracks.Item(i).Comment = comment
- If CheckRelease And QueryPage <> "MetalArchives" And ((CheckDontFillEmptyFields = True And CurrentReleaseId <> "") Or CheckDontFillEmptyFields = False) Then
- If ReleaseTag = "Custom1" Then SDB.Tools.WebSearch.NewTracks.Item(i).Custom1 = CurrentReleaseId
- If ReleaseTag = "Custom2" Then SDB.Tools.WebSearch.NewTracks.Item(i).Custom2 = CurrentReleaseId
- If ReleaseTag = "Custom3" Then SDB.Tools.WebSearch.NewTracks.Item(i).Custom3 = CurrentReleaseId
- If ReleaseTag = "Custom4" Then SDB.Tools.WebSearch.NewTracks.Item(i).Custom4 = CurrentReleaseId
- If ReleaseTag = "Custom5" Then SDB.Tools.WebSearch.NewTracks.Item(i).Custom5 = CurrentReleaseId
- If ReleaseTag = "Grouping" Then SDB.Tools.WebSearch.NewTracks.Item(i).Grouping = CurrentReleaseId
- If ReleaseTag = "ISRC" Then SDB.Tools.WebSearch.NewTracks.Item(i).ISRC = CurrentReleaseId
- If ReleaseTag = "Encoder" Then SDB.Tools.WebSearch.NewTracks.Item(i).Encoder = CurrentReleaseId
- If ReleaseTag = "Copyright" Then SDB.Tools.WebSearch.NewTracks.Item(i).Copyright = CurrentReleaseId
- End If
- If CheckCatalog And ((CheckDontFillEmptyFields = True And theCatalogs <> "") Or CheckDontFillEmptyFields = False) Then
- If CatalogTag = "Custom1" Then SDB.Tools.WebSearch.NewTracks.Item(i).Custom1 = theCatalogs
- If CatalogTag = "Custom2" Then SDB.Tools.WebSearch.NewTracks.Item(i).Custom2 = theCatalogs
- If CatalogTag = "Custom3" Then SDB.Tools.WebSearch.NewTracks.Item(i).Custom3 = theCatalogs
- If CatalogTag = "Custom4" Then SDB.Tools.WebSearch.NewTracks.Item(i).Custom4 = theCatalogs
- If CatalogTag = "Custom5" Then SDB.Tools.WebSearch.NewTracks.Item(i).Custom5 = theCatalogs
- If CatalogTag = "ISRC" Then SDB.Tools.WebSearch.NewTracks.Item(i).ISRC = theCatalogs
- End If
- If CheckCountry And QueryPage <> "MetalArchives" And ((CheckDontFillEmptyFields = True And theCountry <> "") Or CheckDontFillEmptyFields = False) Then
- If CountryTag = "Custom1" Then SDB.Tools.WebSearch.NewTracks.Item(i).Custom1 = theCountry
- If CountryTag = "Custom2" Then SDB.Tools.WebSearch.NewTracks.Item(i).Custom2 = theCountry
- If CountryTag = "Custom3" Then SDB.Tools.WebSearch.NewTracks.Item(i).Custom3 = theCountry
- If CountryTag = "Custom4" Then SDB.Tools.WebSearch.NewTracks.Item(i).Custom4 = theCountry
- If CountryTag = "Custom5" Then SDB.Tools.WebSearch.NewTracks.Item(i).Custom5 = theCountry
- End If
- If CheckFormat And ((CheckDontFillEmptyFields = True And theFormat <> "") Or CheckDontFillEmptyFields = False) Then
- If FormatTag = "Custom1" Then SDB.Tools.WebSearch.NewTracks.Item(i).Custom1 = theFormat
- If FormatTag = "Custom2" Then SDB.Tools.WebSearch.NewTracks.Item(i).Custom2 = theFormat
- If FormatTag = "Custom3" Then SDB.Tools.WebSearch.NewTracks.Item(i).Custom3 = theFormat
- If FormatTag = "Custom4" Then SDB.Tools.WebSearch.NewTracks.Item(i).Custom4 = theFormat
- If FormatTag = "Custom5" Then SDB.Tools.WebSearch.NewTracks.Item(i).Custom5 = theFormat
- End If
- Next
- End If
- End If
- NewResult = False
- SDB.Tools.WebSearch.RefreshViews
- WriteLog " "
- WriteLog "Stop ReloadResults"
- End Sub
- Function convert_date(ReleaseDate)
- Dim Day, Mon, Year, tmp, tmp2
- Day = ""
- Mon = ""
- Year = ""
- If ReleaseDate = "Unknown" Then
- ReleaseDate = ""
- Else
- If InStr(ReleaseDate, ",") = 0 And InStr(ReleaseDate, " ") > 0 Then
- tmp = InStr(ReleaseDate, " ")
- Mon = Left(ReleaseDate, tmp - 1)
- Year = Mid(ReleaseDate, tmp + 1)
- ElseIf InStr(ReleaseDate, ",") > 0 Then
- tmp = InStr(ReleaseDate, ",")
- Year = Mid(ReleaseDate, tmp + 2)
- tmp2 = Left(ReleaseDate, tmp -1)
- tmp = InStr(tmp2, " ")
- Mon = Left(tmp2, tmp - 1)
- Day = Mid(tmp2, tmp + 1)
- End If
- If Mon = "January" Then Mon = "01"
- If Mon = "February" Then Mon = "02"
- If Mon = "March" Then Mon = "03"
- If Mon = "April" Then Mon = "04"
- If Mon = "May" Then Mon = "05"
- If Mon = "June" Then Mon = "06"
- If Mon = "July" Then Mon = "07"
- If Mon = "August" Then Mon = "08"
- If Mon = "September" Then Mon = "09"
- If Mon = "October" Then Mon = "10"
- If Mon = "November" Then Mon = "11"
- If Mon = "December" Then Mon = "12"
- If Day <> "" Then
- tmp = Len(Day)
- Day = Left(Day, tmp - 2)
- If Int(Day) < 10 Then
- Day = "0" & Day
- End If
- End If
- If Year <> "" And Mon <> "" And Day <> "" Then
- ReleaseDate = Day & "." & Mon & "." & Year
- ElseIf Year <> "" And Mon <> "" And Day = "" Then
- ReleaseDate = "00." & Mon & "." & Year
- End If
- End If
- convert_date = ReleaseDate
- End Function
- Function RelationshipTypes(JSONArray)
- Dim rType, i, a, nType, found, instrument, cInstr
- ReDim role(0)
- WriteLog "Start RelTypes"
- SDB.ProcessMessages
- rType = JSONArray("type")
- nType = ""
- cInstr = 0
- If rType <> "other version" Then
- If JSONArray("attributes").Count > 0 Then
- For a = 0 to JSONArray("attributes").Count -1
- found = false
- For i = 0 to RelationAttrList.Count -1
- If LCase(RelationAttrList.Item(i)) = JSONArray("attributes")(a) Then
- nType = nType & RelationAttrList.Item(i) & " "
- WriteLog "Attribute found: " & RelationAttrList.Item(i)
- found = true
- End If
- Next
- If found = false Then
- If rType = "instrument" Then
- cInstr = cInstr + 1
- ReDim Preserve role(cInstr+1)
- role(0) = cInstr
- role(cInstr) = nType & UCase(Left(JSONArray("attributes")(a), 1)) & Mid(JSONArray("attributes")(a), 2)
- WriteLog cInstr & ". Instrument: " & role(cInstr)
- End If
- End If
- Next
- End If
- If rType <> "instrument" Then
- If rType = "vocal" Then rType = "vocals"
- ReDim role(2)
- role(0) = 1
- role(1) = nType & UCase(Left(rType, 1)) & Mid(rType, 2)
- WriteLog "Found Role=" & role(1)
- End If
- Else
- WriteLog "other Version found!!"
- REM SDB.MessageBox "other Version found!!", mtInformation, Array(mbOk)
- ReDim role(1)
- role(0) = 0
- End If
- RelationshipTypes = role
- WriteLog "Stop RelTypes"
- End Function
- Function trackNumbering(ByRef pos, byRef position, byRef TracksNum, byRef TracksCD, byRef iTrackNum, FormatCnt)
- WriteLog "start trackNumbering"
- Dim TrackPosition
- If pos > 1 And CheckNoDisc = False And FormatCnt > 1 Then ' Disc Number Included
- WriteLog "Disc Number Included"
- If CheckForceNumeric Then
- If Left(position,2) = "CD" Then
- If iAutoDiscFormat <> "CD" Then
- iAutoDiscFormat = "CD"
- iAutoTrackNumber = 1
- iAutoDiscNumber = 1
- End If
- If Mid(position,3,1) = "-" Then
- iAutoDiscNumber = 1
- Else
- If iAutoDiscNumber <> Mid(position,3,1) Then
- iAutoTrackNumber = 1
- End If
- End If
- End If
- If Left(position,3) = "DVD" Then
- If iAutoDiscFormat <> "DVD" Then
- iAutoDiscFormat = "DVD"
- iAutoDiscNumber = 1
- iAutoTrackNumber = 1
- End If
- If Mid(position,4,1) = "-" Then
- iAutoDiscNumber = 1
- Else
- If iAutoDiscNumber <> Mid(position,4,1) Then
- iAutoTrackNumber = 1
- End If
- End If
- End If
- If Left(position,3) = "VHS" Then
- If iAutoDiscFormat <> "VHS" Then
- iAutoDiscFormat = "VHS"
- iAutoTrackNumber = 1
- iAutoDiscNumber = 1
- End If
- If Mid(position,4,1) = "-" Then
- iAutoDiscNumber = 1
- Else
- If iAutoDiscNumber <> Mid(position,4,1) Then
- iAutoTrackNumber = 1
- End If
- End If
- End If
- If Left(position,5) = "Video" Then
- If iAutoDiscFormat <> "Video" Then
- iAutoDiscFormat = "Video"
- iAutoTrackNumber = 1
- iAutoDiscNumber = 1
- End If
- If Mid(position,6,1) = "-" Then
- iAutoDiscNumber = 1
- Else
- If iAutoDiscNumber <> Mid(position,6,1) Then
- iAutoTrackNumber = 1
- End If
- End If
- End If
- If Left(position,2) <> "CD" And Left(position,3) <> "DVD" And Left(position,3) <> "VHS" And Left(position,5) <> "Video" And IsInteger(Left(position,pos-1)) Then
- If Int(iAutoDiscNumber) <> Int(Left(position,pos-1)) Then
- iAutoTrackNumber = 1
- End If
- End If
- If UnselectedTracks(iTrackNum) <> "x" Then
- If CheckLeadingZero = True And iAutoTrackNumber < 10 Then
- tracksNum.Add "0" & iAutoTrackNumber
- WriteLog "Tracknumber=0" & iAutoTrackNumber
- Else
- tracksNum.Add iAutoTrackNumber
- WriteLog "Tracknumber=" & iAutoTrackNumber
- End If
- iAutoTrackNumber = iAutoTrackNumber + 1
- Else
- tracksNum.Add ""
- WriteLog "Tracknumber=Nothing"
- End If
- Else
- If pos > 0 Then
- TrackPosition = Mid(position, pos+1)
- If Len(TrackPosition) > 1 Then 'minimum 2 Char after - (1-1a, 1-II, 1-12)
- If IsInteger(Left(TrackPosition, 1)) And Not IsInteger(Right(Trackposition, 1)) Then 'Minimum first is a Number, Char at the end (1-1a, 1-1b, 1-1c,...) = maybe Sub-Track !
- tracksNum.Add TrackPosition
- WriteLog "Tracknumber=" & TrackPosition
- ElseIf IsInteger(TrackPosition) Then 'no char at all (1-01, 1-02, 1-12)
- If CheckLeadingZero = True And Int(TrackPosition) < 10 Then
- tracksNum.Add "0" & Int(TrackPosition)
- WriteLog "Tracknumber=0" & Int(TrackPosition)
- Else
- tracksNum.Add TrackPosition
- WriteLog "Tracknumber=" & TrackPosition
- End If
- Else
- tracksNum.Add TrackPosition
- End If
- ElseIf Len(TrackPosition) = 1 Then '1 Char after - (1-1, 1-I, 1-2)
- If IsInteger(TrackPosition) Then
- If CheckLeadingZero = True And TrackPosition < 10 Then
- tracksNum.Add "0" & TrackPosition
- WriteLog "Tracknumber=0" & TrackPosition
- Else
- tracksNum.Add TrackPosition
- WriteLog "Tracknumber=" & TrackPosition
- End If
- Else
- tracksNum.Add TrackPosition
- WriteLog "Tracknumber=" & TrackPosition
- End If
- End If
- End If
- If UnselectedTracks(iTrackNum) <> "x" Then
- If IsInteger(TrackPosition) Then
- iAutoTrackNumber = TrackPosition + 1
- Else
- iAutoTrackNumber = iAutoTrackNumber + 1
- End If
- End If
- End If
- If Left(position,2) = "CD" Then
- If iAutoDiscFormat <> "CD" Then
- iAutoDiscFormat = "CD"
- iAutoTrackNumber = 1
- iAutoDiscNumber = 1
- End If
- If Mid(position,3,1) = "-" Then
- 'Or Mid(position,3,1) = "." Then
- iAutoDiscNumber = 1
- Else
- iAutoDiscNumber = Mid(position,3,1)
- End If
- End If
- If Left(position,3) = "DVD" Then
- If iAutoDiscFormat <> "DVD" Then
- iAutoDiscFormat = "DVD"
- iAutoTrackNumber = 1
- iAutoDiscNumber = 1
- End If
- If Mid(position,4,1) = "-" Then
- 'Or Mid(position,3,1) = "." Then
- iAutoDiscNumber = 1
- Else
- iAutoDiscNumber = Mid(position,4,1)
- End If
- End If
- If Left(position,3) = "VHS" Then
- If iAutoDiscFormat <> "VHS" Then
- iAutoDiscFormat = "VHS"
- iAutoTrackNumber = 1
- iAutoDiscNumber = 1
- End If
- If Mid(position,4,1) = "-" Then
- 'Or Mid(position,3,1) = "." Then
- iAutoDiscNumber = 1
- Else
- iAutoDiscNumber = Mid(position,4,1)
- End If
- End If
- If Left(position,5) = "Video" Then
- If iAutoDiscFormat <> "Video" Then
- iAutoDiscFormat = "Video"
- iAutoTrackNumber = 1
- iAutoDiscNumber = 1
- End If
- If Mid(position,6,1) = "-" Then
- 'Or Mid(position,3,1) = "." Then
- iAutoDiscNumber = 1
- Else
- iAutoDiscNumber = Mid(position,6,1)
- End If
- End If
- If Left(position,2) <> "CD" And Left(position,3) <> "DVD" And Left(position,3) <> "VHS" And Left(position,5) <> "Video" Then iAutoDiscNumber = Left(position,pos-1)
- tracksCD.Add LeadingZeroDisc(iAutoDiscNumber)
- Else ' Apply Track Numbering Schemes
- WriteLog "Track Numbering Schemes"
- If Not CheckSidesToDisc Or IsInteger(Left(position,1)) Then
- WriteLog "Standard track numbering"
- If CheckForceNumeric Then
- If UnselectedTracks(iTrackNum) <> "x" Then
- If CheckLeadingZero = True And iAutoTrackNumber < 10 Then
- tracksNum.Add "0" & iAutoTrackNumber
- WriteLog "Tracknumber=0" & iAutoTrackNumber
- Else
- tracksNum.Add iAutoTrackNumber
- WriteLog "Tracknumber=" & iAutoTrackNumber
- End If
- iAutoTrackNumber = iAutoTrackNumber + 1
- Else
- tracksNum.Add ""
- WriteLog "Tracknumber=Nothing"
- End If
- Else
- If CheckLeadingZero = True And IsNumeric(position) Then
- If position < 10 And position > 0 Then
- tracksNum.Add "0" & position
- WriteLog "Tracknumber=0" & position
- Else
- tracksNum.Add position
- WriteLog "Tracknumber=" & position
- End If
- Else
- tracksNum.Add position
- WriteLog "Tracknumber=" & position
- End If
- If UnselectedTracks(iTrackNum) <> "x" Then
- If IsNumeric(position) Then
- iAutoTrackNumber = position + 1
- Else
- iAutoTrackNumber = iAutoTrackNumber + 1
- End If
- End If
- End If
- If CheckForceDisc Then
- tracksCD.Add LeadingZeroDisc(iAutoDiscNumber)
- Else
- tracksCD.Add ""
- End If
- Else
- If Len(position) = 1 Then ' Only side is specified
- WriteLog "Only side is specified"
- If CheckLeadingZero = True Then
- tracksNum.Add "01"
- WriteLog "Tracknumber=01"
- Else
- tracksNum.Add "1"
- WriteLog "Tracknumber=1"
- End If
- If LastDisc <> position Then
- If LastDisc <> "" Then
- iAutoDiscNumber = iAutoDiscNumber + 1
- End If
- LastDisc = position
- End If
- If CheckForceNumeric Then
- tracksCD.Add LeadingZeroDisc(iAutoDiscNumber)
- Else
- tracksCD.Add LeadingZeroDisc(position)
- End If
- ElseIf Len(position) = 2 Then
- If IsInteger(Mid(position,2,1)) And Not IsInteger(Mid(position,1,1)) Then
- WriteLog "First is Side Second is Track"
- ' First is Side Second is Track
- ' WriteLog iAutoDiscNumber
- ' WriteLog iAutoTrackNumber
- If LastDisc <> Left(position,1) Then
- If LastDisc <> "" And (LastDisc = "B" Or LastDisc = "D" Or LastDisc = "F" Or LastDisc = "H" Or LastDisc = "J") Then
- If IsInteger(iAutoDiscNumber) Then
- iAutoDiscNumber = iAutoDiscNumber + 1
- End If
- iAutoTrackNumber = 1
- End If
- LastDisc = Left(position,1)
- End If
- If UnselectedTracks(iTrackNum) <> "x" Then
- ' If CheckLeadingZero = True And Mid(position,2) < 10 Then
- If CheckLeadingZero = True And iAutoTrackNumber < 10 Then
- ' tracksNum.Add "0" & Mid(position,2)
- tracksNum.Add "0" & iAutoTrackNumber
- WriteLog "Tracknumber=0" & iAutoTrackNumber
- iAutoTrackNumber = iAutoTrackNumber + 1
- Else
- ' tracksNum.Add Mid(position,2)
- tracksNum.Add iAutoTrackNumber
- WriteLog "Tracknumber=" & iAutoTrackNumber
- iAutoTrackNumber = iAutoTrackNumber + 1
- End If
- Else
- tracksNum.Add ""
- WriteLog "Tracknumber=Nothing"
- End If
- If CheckForceNumeric Then
- tracksCD.Add LeadingZeroDisc(iAutoDiscNumber)
- Else
- tracksCD.Add LeadingZeroDisc(Left(position,1))
- End If
- Else ' Two byte side
- WriteLog "Two byte side"
- tracksNum.Add "1"
- WriteLog "Tracknumber=1"
- If LastDisc <> position Then
- If LastDisc <> "" Then
- iAutoDiscNumber = iAutoDiscNumber + 1
- End If
- LastDisc = position
- End If
- If CheckForceNumeric Then
- tracksCD.Add LeadingZeroDisc(iAutoDiscNumber)
- Else
- tracksCD.Add LeadingZeroDisc(position)
- End If
- End If
- Else ' More than 2 bytes
- If IsInteger(Mid(position,2)) And CheckNoDisc = False Then
- WriteLog "First is Side Latter is Track"
- 'First is Side Latter is Track
- If UnselectedTracks(iTrackNum) <> "x" Then
- tracksNum.Add Mid(position,2)
- WriteLog "Tracknumber=" & Mid(position,2)
- Else
- tracksNum.Add ""
- WriteLog "Tracknumber=Nothing"
- End If
- If LastDisc <> Left(position,1) Then
- If LastDisc <> "" Then
- iAutoDiscNumber = iAutoDiscNumber + 1
- End If
- LastDisc = Left(position,1)
- End If
- If CheckForceNumeric Then
- tracksCD.Add LeadingZeroDisc(iAutoDiscNumber)
- Else
- tracksCD.Add LeadingZeroDisc(Left(position,1))
- End If
- ElseIf IsInteger(Mid(position,3)) And CheckNoDisc = False Then
- WriteLog "Two Byte Side, Latter is Track"
- ' Two Byte Side, Latter is Track
- If UnselectedTracks(iTrackNum) <> "x" Then
- tracksNum.Add Mid(position,3)
- WriteLog "Tracknumber=" & Mid(position,3)
- Else
- tracksNum.Add ""
- WriteLog "Tracknumber=Nothing"
- End If
- If LastDisc <> Left(position,2) Then
- If LastDisc <> "" Then
- iAutoDiscNumber = iAutoDiscNumber + 1
- End If
- LastDisc = Left(position,2)
- End If
- If CheckForceNumeric Then
- tracksCD.Add LeadingZeroDisc(iAutoDiscNumber)
- Else
- tracksCD.Add LeadingZeroDisc(Left(position,2))
- End If
- Else ' More than two non numeric bytes!
- WriteLog "More than two non numeric bytes!"
- If CheckNoDisc = False Then
- If UnselectedTracks(iTrackNum) <> "x" Then
- tracksNum.Add position
- WriteLog "Tracknumber=" & position
- tracksCD.Add ""
- Else
- tracksNum.Add ""
- WriteLog "Tracknumber=Nothing"
- tracksCD.Add ""
- End If
- Else
- If CheckForceNumeric Then
- If UnselectedTracks(iTrackNum) <> "x" Then
- If CheckLeadingZero = True And iAutoTrackNumber < 10 Then
- tracksNum.Add "0" & iAutoTrackNumber
- WriteLog "Tracknumber=0" & iAutoTrackNumber
- Else
- tracksNum.Add iAutoTrackNumber
- WriteLog "Tracknumber=" & iAutoTrackNumber
- End If
- iAutoTrackNumber = iAutoTrackNumber + 1
- Else
- tracksNum.Add ""
- WriteLog "Tracknumber=Nothing"
- End If
- Else
- If UnselectedTracks(iTrackNum) <> "x" Then
- If IsInteger(position) Then
- tracksNum.Add iAutoTrackNumber
- WriteLog "Tracknumber=" & iAutoTrackNumber
- iAutoTrackNumber = position + 1
- Else
- tracksNum.Add iAutoTrackNumber
- WriteLog "Tracknumber=" & iAutoTrackNumber
- iAutoTrackNumber = iAutoTrackNumber + 1
- End If
- End If
- End If
- tracksCD.Add ""
- End If
- End If
- End If
- End If
- End If
- ' WriteLog "iAutoTrackNumber=" & iAutoTrackNumber
- ' WriteLog "iTrackNum=" & iTrackNum
- ' WriteLog "tracksnum.item(iTrackNum)=" & tracksnum.item(iTrackNum)
- End Function
- Function getinvolvedRole(involvedArtist, involvedRole, byRef artistList, byRef TrackFeaturing, byRef Involved_R_T, byRef TrackComposers, byRef TrackConductors, byRef TrackProducers, byRef TrackLyricists)
- WriteLog "Start getinvolvedRole"
- Dim tmp, tmp2
- If LookForFeaturing(involvedRole) Then
- If InStr(artistList, involvedArtist) = 0 Then
- If TrackFeaturing = "" Then
- If CheckFeaturingName Then
- TrackFeaturing = TxtFeaturingName & " " & involvedArtist
- Else
- TrackFeaturing = involvedRole & " " & involvedArtist
- End If
- Else
- If InStr(TrackFeaturing, involvedArtist) = 0 Then
- TrackFeaturing = TrackFeaturing & ArtistSeparator & involvedArtist
- End If
- End If
- End If
- WriteLog "TrackFeaturing=" & TrackFeaturing
- Else
- Do
- tmp = searchKeyword(LyricistKeywords, involvedRole, TrackLyricists, involvedArtist)
- If tmp <> "" And tmp <> "ALREADY_INSIDE_ROLE" Then
- TrackLyricists = tmp
- WriteLog "TrackLyricists=" & TrackLyricists
- Exit Do
- ElseIf tmp = "ALREADY_INSIDE_ROLE" Then
- WriteLog "ALREADY_INSIDE_ROLE"
- Exit Do
- End If
- tmp = searchKeyword(ConductorKeywords, involvedRole, TrackConductors, involvedArtist)
- If tmp <> "" And tmp <> "ALREADY_INSIDE_ROLE" Then
- TrackConductors = tmp
- WriteLog "TrackConductors=" & TrackConductors
- Exit Do
- ElseIf tmp = "ALREADY_INSIDE_ROLE" Then
- WriteLog "ALREADY_INSIDE_ROLE"
- Exit Do
- End If
- tmp = searchKeyword(ProducerKeywords, involvedRole, TrackProducers, involvedArtist)
- If tmp <> "" And tmp <> "ALREADY_INSIDE_ROLE" Then
- TrackProducers = tmp
- WriteLog "TrackProducers=" & TrackProducers
- Exit Do
- ElseIf tmp = "ALREADY_INSIDE_ROLE" Then
- WriteLog "ALREADY_INSIDE_ROLE"
- Exit Do
- End If
- tmp = searchKeyword(ComposerKeywords, involvedRole, TrackComposers, involvedArtist)
- If tmp <> "" And tmp <> "ALREADY_INSIDE_ROLE" Then
- TrackComposers = tmp
- WriteLog "TrackComposers=" & TrackComposers
- Exit Do
- ElseIf tmp = "ALREADY_INSIDE_ROLE" Then
- WriteLog "ALREADY_INSIDE_ROLE"
- Exit Do
- End If
- tmp2 = search_involved(Involved_R_T, involvedRole)
- If tmp2 = -2 Then
- WriteLog "Ignore Role: '" & currentRole & "' (Unwanted tag)"
- ElseIf tmp2 = -1 Then
- ReDim Preserve Involved_R_T(UBound(Involved_R_T)+1)
- Involved_R_T(UBound(Involved_R_T)) = involvedRole & ": " & involvedArtist
- WriteLog "New Role: " & involvedRole & ": " & involvedArtist
- Else
- If InStr(Involved_R_T(tmp2), involvedArtist) = 0 Then
- Involved_R_T(tmp2) = Involved_R_T(tmp2) & ArtistSeparator & involvedArtist
- WriteLog "Role updated: " & Involved_R_T(tmp2)
- Else
- WriteLog "artist already inside role"
- End If
- End If
- Exit Do
- Loop While True
- End If
- WriteLog "Stop getinvolvedRole"
- End Function
- Function CheckSpecialRole(Role)
- Dim tmp, tmp2, tmp3
- WriteLog "Start CheckSpecialRole"
- ReDim SingleRole(0)
- Do While 1 = 1
- tmp = InStr(Role, ",")
- tmp2 = InStr(Role, "[")
- tmp3 = InStr(Role, "]")
- If tmp = 0 Then
- ReDim Preserve SingleRole(UBound(SingleRole)+1)
- SingleRole(UBound(SingleRole)) = Role
- Exit Do
- End If
- If tmp < tmp2 Then
- ReDim Preserve SingleRole(UBound(SingleRole)+1)
- SingleRole(UBound(SingleRole)) = Left(Role, tmp-1)
- Role = LTrim(Mid(Role, tmp+1))
- End If
- If tmp > tmp2 And tmp > tmp3 Then
- ReDim Preserve SingleRole(UBound(SingleRole)+1)
- SingleRole(UBound(SingleRole)) = Left(Role, tmp-1)
- Role = LTrim(Mid(Role, tmp+1))
- End If
- If tmp > tmp2 And tmp < tmp3 Then
- tmp = InStr(tmp3, Role, ",", 0)
- ReDim Preserve SingleRole(UBound(SingleRole)+1)
- If tmp <> 0 Then
- SingleRole(UBound(SingleRole)) = Left(Role, tmp-1)
- Role = LTrim(Mid(Role, tmp+1))
- Else
- SingleRole(UBound(SingleRole)) = Role
- Exit Do
- End If
- End If
- Loop
- WriteLog "End CheckSpecialRole"
- CheckSpecialRole = SingleRole
- End Function
- Function FindSubTrackSplit(position)
- Dim tmp
- For tmp = 2 To Len(position)
- If Not IsNumeric(Mid(position, tmp, 1)) Then
- FindSubTrackSplit = Left(position, tmp-1)
- Exit For
- End If
- Next
- End Function
- Function FindArtist(ArtistList1, ArtistList2)
- Dim tmpArtist, i
- ReDim newArtistList1(0)
- tmpArtist = Split(ArtistList1, ArtistSeparator)
- For i = 0 To UBound(tmpArtist)
- If InStr(ArtistList2,tmpArtist(i)) = 0 Then
- ReDim Preserve newArtistList1(UBound(newArtistList1)+1)
- newArtistList1(UBound(newArtistList1)) = tmpArtist(i)
- End If
- Next
- For i = 0 To UBound(newArtistList1)
- If FindArtist = "" Then
- FindArtist = newArtistList1(i)
- Else
- FindArtist = FindArtist & ArtistSeparator & newArtistList1(i)
- End If
- Next
- End Function
- Sub Track_from_to (currentTrack, currentArtist, involvedRole, Title_Position, TrackRoles, TrackArtist2, TrackPos, LeadingZeroTrackPosition)
- WriteLog "Start Track_from_to"
- Dim tmp, tmp4, cnt, ret
- Dim StartTrack, EndTrack
- WriteLog "currentTrack=" & currentTrack
- If InStr(currentTrack, " ") <> 0 Then
- WriteLog "Warning: More than one space between the track positions !!!"
- Do
- If InStr(currentTrack, " ") = 0 Then Exit Do
- currentTrack = Replace(currentTrack, " ", " ")
- Loop While True
- End If
- tmp = Split(currentTrack, " to ")
- StartTrack = Trim(tmp(0))
- EndTrack = trim(tmp(1))
- WriteLog "StartTrack=" & StartTrack
- WriteLog "EndTrack=" & EndTrack
- tmp4 = False
- For cnt = 0 To UBound(Title_Position)-1
- If Title_Position(cnt) = StartTrack Then
- tmp4 = True
- End If
- If Title_Position(cnt) = EndTrack Then
- ReDim Preserve TrackRoles(UBound(TrackRoles)+1)
- ReDim Preserve TrackArtist2(UBound(TrackArtist2)+1)
- ReDim Preserve TrackPos(UBound(TrackPos)+1)
- TrackArtist2(UBound(TrackArtist2)) = currentArtist
- TrackRoles(UBound(TrackRoles)) = involvedRole
- TrackPos(UBound(TrackPos)) = Title_Position(cnt)
- WriteLog "Pos: " & Title_Position(cnt) & " " & currentArtist & " - " & involvedRole
- Exit For
- End If
- If tmp4 = True Then
- ReDim Preserve TrackRoles(UBound(TrackRoles)+1)
- ReDim Preserve TrackArtist2(UBound(TrackArtist2)+1)
- ReDim Preserve TrackPos(UBound(TrackPos)+1)
- TrackArtist2(UBound(TrackArtist2)) = currentArtist
- TrackRoles(UBound(TrackRoles)) = involvedRole
- TrackPos(UBound(TrackPos)) = Title_Position(cnt)
- WriteLog "Pos: " & Title_Position(cnt) & " " & currentArtist & " - " & involvedRole
- End If
- Next
- WriteLog "Stop Track_from_to"
- End Sub
- Function Remove_CD(TrackPos)
- If Left(TrackPos, 2) = "CD" Then
- TrackPos = Mid(TrackPos, 3)
- End If
- If Left(TrackPos, 3) = "DVD" Then
- TrackPos = Mid(TrackPos, 4)
- End If
- If UCase(Left(TrackPos, 6)) = "VIDEO " Then
- TrackPos = Mid(TrackPos, 7)
- End If
- If UCase(Left(TrackPos, 5)) = "VIDEO" Then
- TrackPos = Mid(TrackPos, 6)
- End If
- If UCase(Left(TrackPos, 3)) = "VHS" Then
- TrackPos = Mid(TrackPos, 4)
- End If
- If UCase(Left(TrackPos, 5)) = "VIDEO" Then
- TrackPos = Mid(TrackPos, 6)
- End If
- Return TrackPos
- End Function
- Sub Add_Track_Role(currentTrack, currentArtist, involvedRole, TrackRoles, TrackArtist2, TrackPos, LeadingZeroTrackPosition)
- Dim tmp4
- If InStr(currentTrack, "-") <> 0 Then
- tmp4 = Split(currentTrack, "-")
- If IsNumeric(tmp4(1)) = True Then
- If LeadingZeroTrackPosition = True And tmp4(1) < 10 And Left(tmp4(1), 1) <> "0" Then
- currentTrack = tmp4(0) & "-0" & tmp4(1)
- End If
- End If
- End If
- If InStr(currentTrack, ".") <> 0 Then
- tmp4 = Split(currentTrack, ".")
- If IsNumeric(tmp4(1)) = True Then
- If LeadingZeroTrackPosition = True And tmp4(1) < 10 And Left(tmp4(1), 1) <> "0" Then
- currentTrack = tmp4(0) & ".0" & tmp4(1)
- End If
- End If
- End If
- WriteLog "currentTrack=" & currentTrack
- currentTrack = exchange_roman_numbers(currentTrack)
- ReDim Preserve TrackRoles(UBound(TrackRoles)+1)
- ReDim Preserve TrackArtist2(UBound(TrackArtist2)+1)
- ReDim Preserve TrackPos(UBound(TrackPos)+1)
- TrackArtist2(UBound(TrackArtist2)) = currentArtist
- TrackRoles(UBound(TrackRoles)) = involvedRole
- TrackPos(UBound(TrackPos)) = currentTrack
- End Sub
- ' ShowResult is called every time the search result is changed from the drop
- ' down at the top of the window
- Sub ShowResult(ResultID)
- Dim ReleaseID, searchURL, oXMLHTTP, ResponseHTML, Title, SelectedTracks, searchURL_F, searchURL_L, i
- For i = 0 to 999
- UnselectedTracks(i) = ""
- UnselectedTrackNames(i) = ""
- Next
- SDB.Tools.WebSearch.ClearTracksData
- NewResult = True
- WebBrowser.SetHTMLDocument "" ' Deletes visible search result
- If ResultsReleaseID.Item(ResultID) = "" Then Exit Sub
- Dim json
- Set json = New VbsJson
- CurrentResultId = ResultID
- If QueryPage = "MetalArchives" Then
- searchURL = ResultsReleaseID.Item(ResultID)
- Set oXMLHTTP = CreateObject("MSXML2.XMLHTTP.6.0")
- Call oXMLHTTP.open("GET", searchURL, False)
- Call oXMLHTTP.send()
- If oXMLHTTP.Status = 200 Then
- CurrentRelease = oXMLHTTP.responseText
- ReloadResults
- End If
- End If
- ' http://musicbrainz.org/ws/2/release/e3b950f4-cc3b-3f84-b80f-2c254ffd956f?inc=recordings+recording-level-rels+work-rels+work-level-rels+artist-rels+artist-credits+media+release-group-rels+release-groups+labels&fmt=json
- If QueryPage = "MusicBrainz" Then
- WriteLog "+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-"
- WriteLog "Start ShowResult MusicBrainz"
- ReleaseID = ResultsReleaseID.Item(ResultID)
- WriteLog "ReleaseID=" & ReleaseID
- If InStr(Results.Item(ResultID), "No Release found") = 0 Then
- searchURL = "http://musicbrainz.org/ws/2/release/" & ReleaseID & "?inc=recordings+recording-level-rels+work-rels+work-level-rels+artist-rels+artist-credits+media+release-group-rels+release-groups+labels&fmt=json"
- WriteLog "searchURL=" & searchURL
- Set oXMLHTTP = CreateObject("MSXML2.ServerXMLHTTP.6.0")
- oXMLHTTP.Open "GET", searchURL, False
- oXMLHTTP.setRequestHeader "Content-Type", "application/json"
- oXMLHTTP.setRequestHeader "User-Agent",UserAgent
- oXMLHTTP.send ()
- If oXMLHTTP.Status = 200 Then
- WriteLog "responseText=" & oXMLHTTP.responseText
- Set CurrentRelease = json.Decode(oXMLHTTP.responseText)
- CurrentReleaseId = ReleaseID
- ReloadResults
- ElseIf oXMLHTTP.Status = 503 Then
- ErrorMessage = "Status:" & oXMLHTTP.Status & " - The number of requests exceeds the limit. Please try again later"
- WriteLog "Status=" & oXMLHTTP.Status
- FormatErrorMessage ErrorMessage
- Else
- ErrorMessage = "Status:" & oXMLHTTP.Status & " - Please try again later"
- WriteLog "Status=" & oXMLHTTP.Status
- FormatErrorMessage ErrorMessage
- &n