Skip to content
This repository has been archived by the owner on Mar 3, 2023. It is now read-only.

Commit

Permalink
Updated VNDBMetadata Plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
erri120 committed Oct 26, 2020
1 parent 3973f7e commit 6052abe
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ Change any fields you want afterwards and click the _Save_ button in the bottom
- Community Score
- Genres
- Links
- Platform

**Usage**:

Expand Down
14 changes: 13 additions & 1 deletion VNDBMetadata/VNDBMetadataProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,9 @@ private List<MetadataField> GetAvailableFields()
list.Add(MetadataField.ReleaseDate);
if (_visualNovel.tags != null && _visualNovel.tags.Count > 0)
list.Add(MetadataField.Genres);

if (_visualNovel.platforms != null && _visualNovel.platforms.Count > 0)
list.Add(MetadataField.Platform);

return list;
}

Expand Down Expand Up @@ -337,6 +339,16 @@ public override List<string> GetGenres()
return tags.Take(StaticSettings.MaxTags).Select(x => x.name).ToList();
}

public override string GetPlatform()
{
if (!AvailableFields.Contains(MetadataField.Platform))
return base.GetPlatform();

return _visualNovel.platforms.Any(x => x.Equals("win", StringComparison.OrdinalIgnoreCase))
? "PC"
: base.GetPlatform();
}

public override void Dispose()
{
_client.Dispose();
Expand Down

0 comments on commit 6052abe

Please sign in to comment.