public override GameMetadata GetMetadata(Game game)
        {
            var metadata = new GameMetadata()
            {
            };
            string type  = string.Empty;
            string idMal = string.Empty;

            try
            {
                var variables = new Dictionary <string, string>
                {
                    { "id", game.GameId }
                };
                string variablesJson = Serialization.ToJson(variables);
                var    postParams    = new Dictionary <string, string>
                {
                    { "query", apiListQueryString },
                    { "variables", variablesJson }
                };
                var response = client.PostAsync(GraphQLEndpoint, new FormUrlEncodedContent(postParams));
                var contents = response.Result.Content.ReadAsStringAsync();

                var mediaEntryData = Serialization.FromJson <MediaEntryData>(contents.Result);
                metadata = AnilistResponseHelper.MediaToGameMetadata(mediaEntryData.Data.Media, true, propertiesPrefix);
                type     = mediaEntryData.Data.Media.Type.ToString().ToLower() ?? string.Empty;
                idMal    = mediaEntryData.Data.Media.IdMal.ToString().ToLower() ?? string.Empty;
            }
            catch (Exception e)
            {
                logger.Error(e, $"Failed to process AniList query");
            }

            if (!string.IsNullOrEmpty(type))
            {
                string queryUri = string.Empty;
                if (!string.IsNullOrEmpty(idMal))
                {
                    queryUri = string.Format(MalSyncMyanimelistEndpoint, type, idMal);
                }
                else
                {
                    queryUri = string.Format(MalSyncAnilistEndpoint, type, game.GameId);
                }

                try
                {
                    if (malSyncRateLimiter.ApiReqRemaining == 0)
                    {
                        Thread.Sleep(5000);
                    }

                    malSyncRateLimiter.Decrease();
                    var response = client.GetAsync(string.Format(queryUri));
                    var contents = response.Result.Content.ReadAsStringAsync();
                    if (!string.IsNullOrEmpty(contents.Result) && contents.Result != "Not found in the fire")
                    {
                        JObject jsonObject = JObject.Parse(contents.Result);
                        if (jsonObject["Sites"] != null)
                        {
                            foreach (var site in jsonObject["Sites"])
                            {
                                string siteName = site.Path.Replace("Sites.", "");

                                foreach (var siteItem in site)
                                {
                                    foreach (var item in siteItem)
                                    {
                                        string str         = item.First().ToString();
                                        var    malSyncItem = Serialization.FromJson <MalSyncSiteItem>(str);
                                        metadata.Links.Add(new Link(string.Format("{0} - {1}", siteName, malSyncItem.Title), malSyncItem.Url));
                                    }
                                }
                            }
                        }
                    }
                    else
                    {
                        logger.Info($"MalSync query {queryUri} doesn't have data");
                    }
                }
                catch (Exception e)
                {
                    logger.Error(e, $"Failed to process MalSync query {queryUri}");
                }
            }

            return(metadata);
        }
        public GameMetadata EntryToGameMetadata(Entry entry)
        {
            var game = AnilistResponseHelper.MediaToGameMetadata(entry.Media, false, settings.Settings.PropertiesPrefix);

            if (entry.Score != 0)
            {
                game.UserScore = entry.Score;
            }

            switch (entry.Status)
            {
            case EntryStatus.Current:
                if (CompletionStatusWatching != null)
                {
                    game.CompletionStatus = new MetadataNameProperty(CompletionStatusWatching.Name);
                }
                break;

            case EntryStatus.Planning:
                if (CompletionStatusPlanWatch != null)
                {
                    game.CompletionStatus = new MetadataNameProperty(CompletionStatusPlanWatch.Name);
                }
                break;

            case EntryStatus.Completed:
                if (CompletionStatusCompleted != null)
                {
                    game.CompletionStatus = new MetadataNameProperty(CompletionStatusCompleted.Name);
                }
                break;

            case EntryStatus.Dropped:
                if (CompletionStatusDropped != null)
                {
                    game.CompletionStatus = new MetadataNameProperty(CompletionStatusDropped.Name);
                }
                break;

            case EntryStatus.Paused:
                if (CompletionStatusPaused != null)
                {
                    game.CompletionStatus = new MetadataNameProperty(CompletionStatusPaused.Name);
                }
                break;

            case EntryStatus.Repeating:
                if (CompletionStatusRewatching != null)
                {
                    game.CompletionStatus = new MetadataNameProperty(CompletionStatusRewatching.Name);
                }
                break;

            default:
                break;
            }

            if (settings.Settings.UpdateProgressOnLibUpdate == true)
            {
                game.Version = GetEntryVersionString(entry);
            }

            return(game);
        }