PlayniteExtensionsCollection icon indicating copy to clipboard operation
PlayniteExtensionsCollection copied to clipboard

[VNDB Nexus] Use VNDB link for metadata

Open edgar1016 opened this issue 1 year ago • 2 comments

Extension name

VNDB Nexus

Feature Description

I added all of my visual novels with the VNDB link attached to each game, it would be nice if there was an option for the metadata part of the extension to search VNDB using the link attached to each game instead of the default behavior being the name. I noticed it struggles to find a lot of them when pulling for metadata in batches. I imported about 600 visual novels and it found maybe 120.

Screenshots

No response

edgar1016 avatar Jun 05 '24 02:06 edgar1016

Trying to get visual studio setup to test it but I think adding these lines to VNDBNexusMetadataProvider.cs in the SearchVisualNovel method should work.

        private void SearchVisualNovel(CancellationToken cancellationToken)
        {
            if (_requestOptions.IsBackgroundDownload)
            {
                var gameName = _requestOptions.GameData.Name;
                var gameLinks = _requestOptions.GameData.Links;

                if (gameLinks != null && gameLinks.Any(link => link.Name.Equals("VNDB", StringComparison.OrdinalIgnoreCase)))
                {
                    var vndbLink = gameLinks.FirstOrDefault(link => link.Name.Equals("VNDB", StringComparison.OrdinalIgnoreCase));
                    var vnID = Regex.Match(vndbLink.Url, @"v\d+");
                    gameName = vnID.Value;
                }

                var searchResults = Task.Run(async () => await GetVnSearchResultsAsync(gameName, cancellationToken))
                    .GetAwaiter()
                    .GetResult();
                var normalizedGameName = gameName.Satinize();

edgar1016 avatar Jun 05 '24 10:06 edgar1016

I imported about 600 visual novels and it found maybe 120.

There was a bug that prevented correctly matching games during background metadata import that has been fixed. Additionally, matching also now checks for aliases and alternative titles. Please try downloading metadata after verifying that you are using the latest version, for a few titles that failed to find a match again to see if the issue remains.

darklinkpower avatar Jun 06 '24 01:06 darklinkpower