Skip to content

Commit

Permalink
Update new url for sprite
Browse files Browse the repository at this point in the history
  • Loading branch information
Wyveth committed Feb 12, 2023
1 parent 6845a52 commit 33a1703
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 13 deletions.
5 changes: 4 additions & 1 deletion WebApiScrapingData.Domain/Class/Pokemon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -119,20 +119,23 @@ public class Pokemon : Identity
public string? UrlImg { get; set; }

//Url de l'Image Interne
[DataMember(Name = DataMember.PathImg)]
public string? PathImg { get; set; }

//Url du Sprite Scrap
[DataMember(Name = DataMember.UrlSprite)]
public string? UrlSprite { get; set; }

//Url du Sprite
[DataMember(Name = DataMember.PathSprite)]
public string? PathSprite { get; set; }

//Url du Sound Scrap
[DataMember(Name = DataMember.UrlSound)]
public string? UrlSound { get; set; }

//Url du Sound
[DataMember(Name = DataMember.PathSound)]
public string? PathSound { get; set; }

[DataMember(Name = DataMember.Game)]
Expand Down
3 changes: 3 additions & 0 deletions WebApiScrapingData.Domain/Class/TypePok.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,17 @@ public class TypePok : Identity

[DataMember(Name = DataMember.UrlFondGo)]
public string? UrlFondGo { get; set; }
[DataMember(Name = DataMember.PathFondGo)]
public string? PathFondGo { get; set; }

[DataMember(Name = DataMember.UrlIconHome)]
public string? UrlIconHome { get; set; }
[DataMember(Name = DataMember.PathIconHome)]
public string? PathIconHome { get; set; }

[DataMember(Name = DataMember.UrlAutoHome)]
public string? UrlAutoHome { get; set; }
[DataMember(Name = DataMember.PathAutoHome)]
public string? PathAutoHome { get; set; }

[DataMember(Name = DataMember.ImgColor)]
Expand Down
16 changes: 8 additions & 8 deletions WebApiScrapingData.Domain/Resources/DataMember.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,19 @@ public static class DataMember
public const string UrlMiniHome_JP = "UrlMiniHome_JP";

public const string UrlMiniGo = "UrlMiniGo";
public const string DataMiniGo = "DataMiniGo";
public const string PathMiniGo = "PathMiniGo";

public const string UrlFondGo = "UrlFondGo";
public const string DataFondGo = "DataFondGo";
public const string PathFondGo = "PathFondGo";

public const string UrlMiniHome = "UrlMiniHome";
public const string DataMiniHome = "DataMiniHome";
public const string PathMiniHome = "PathMiniHome";

public const string UrlIconHome = "UrlIconHome";
public const string DataIconHome = "DataIconHome";
public const string PathIconHome = "PathIconHome";

public const string UrlAutoHome = "UrlAutoHome";
public const string DataAutoHome = "DataAutoHome";
public const string PathAutoHome = "PathAutoHome";

public const string ImgColor = "ImgColor";
public const string InfoColor = "InfoColor";
Expand Down Expand Up @@ -137,15 +137,15 @@ public static class DataMember

public const string UrlImg = "UrlImg";

public const string DataImg = "DataImg";
public const string PathImg = "PathImg";

public const string UrlSprite = "UrlSprite";

public const string DataSprite = "DataSprite";
public const string PathSprite = "PathSprite";

public const string UrlSound = "UrlSound";

public const string DataSound = "DataSound";
public const string PathSound = "PathSound";

public const string NextUrl = "NextUrl";

Expand Down
3 changes: 1 addition & 2 deletions WepApiScrapingData/Controllers/PokemonController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -706,8 +706,7 @@ public Task ImportDb()
json = sr.ReadToEnd();
_repository.ImportJsonToDb(json);
}



return Task.CompletedTask;
}

Expand Down
20 changes: 18 additions & 2 deletions WepApiScrapingData/Utils/ScrapingDataUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1527,6 +1527,18 @@ public static void GetUrlsMini(string html, IRepositoryExtendsPokemon<Pokemon> r
url = listTD[7].Descendants("img").Select(node => node.GetAttributeValue("src", "")).FirstOrDefault();
}

Console.WriteLine(name);
if (name.Equals("Némélios"))
url = "/images/8/8a/Miniature_0668_%E2%99%82_XY.png";
else if (name.Equals("CouafarelForme Sauvage"))
url = "/images/b/b2/Miniature_0676_Sauvage_XY.png";
else if (name.Equals("PlumelineStyle Buyō"))
url = "/images/1/14/Miniature_0741_Buyō_SL.png";
else if (name.Equals("MéténoForme Météore"))
url = "/images/e/e1/Miniature_0774_Météore_SL.png";
else if (name.Equals("Dratatin Gigamax"))
url = "/images/4/45/Miniature_0841_Gigamax_EB.png";

string checkUrl = Constantes.urlPokepedia + url.Replace("%E2%99%82", "♂").Replace("%E2%99%80", "♀");
if (checkUrl != Constantes.urlPokepedia)
{
Expand Down Expand Up @@ -1556,7 +1568,10 @@ public static void GetUrlsMini(string html, IRepositoryExtendsPokemon<Pokemon> r
.Replace("Bekaglaçon Tête de Gel", "Bekaglaçon")
.Replace("Shifours Gigamax Style Poing Final", "Shifours Gigamax (Style Poing Final)")
.Replace("Shifours Gigamax Style Mille Poings", "Shifours Gigamax (Style Mille Poings)")
.Replace("Sylveroy Cavalier d'Effroi", "Sylveroy Cavalier d’Effroi");
.Replace("Sylveroy Cavalier d'Effroi", "Sylveroy Cavalier d’Effroi")
.Replace("CouafarelForme Sauvage", "Couafarel Forme Sauvage")
.Replace("PlumelineStyle Buyō", "Plumeline Style Buyō")
.Replace("MéténoForme Météore", "Météno Forme Météore");

if (checkUrl.Contains("♀"))
{
Expand All @@ -1575,7 +1590,8 @@ public static void GetUrlsMini(string html, IRepositoryExtendsPokemon<Pokemon> r
|| name.Contains("Paragruel")
|| name.Contains("Viskuse")
|| name.Contains("Moyade")
|| name.Contains("Mistigrix"))
|| name.Contains("Mistigrix")
|| name.Contains("Némélios"))
name = name + " " + Constantes.M_FR;
}
}
Expand Down

0 comments on commit 33a1703

Please sign in to comment.