Skip to content

Commit

Permalink
misc: remove unused and redundant methods in image utility
Browse files Browse the repository at this point in the history
  • Loading branch information
revam committed Sep 8, 2024
1 parent a7a9c73 commit 8ddc761
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 23 deletions.
8 changes: 4 additions & 4 deletions Shoko.Server/Extensions/ImageResolvers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public static string GetFullImagePath(this TvDB_Episode episode)
return string.Empty;

var fname = episode.Filename.Replace('/', Path.DirectorySeparatorChar);
return Path.Combine(ImageUtils.GetTvDBImagePath(), fname);
return Path.Combine(ImageUtils.GetBaseTvDBImagesPath(), fname);
}

public static IImageMetadata? GetImageMetadata(this TvDB_ImageFanart fanart, bool preferred = false)
Expand All @@ -88,7 +88,7 @@ public static string GetFullImagePath(this TvDB_ImageFanart fanart)
return string.Empty;

var fname = fanart.BannerPath.Replace('/', Path.DirectorySeparatorChar);
return Path.Combine(ImageUtils.GetTvDBImagePath(), fname);
return Path.Combine(ImageUtils.GetBaseTvDBImagesPath(), fname);
}

public static IImageMetadata? GetImageMetadata(this TvDB_ImagePoster poster, bool preferred = false)
Expand All @@ -106,7 +106,7 @@ public static string GetFullImagePath(this TvDB_ImagePoster poster)
return string.Empty;

var fname = poster.BannerPath.Replace('/', Path.DirectorySeparatorChar);
return Path.Combine(ImageUtils.GetTvDBImagePath(), fname);
return Path.Combine(ImageUtils.GetBaseTvDBImagesPath(), fname);
}

public static IImageMetadata? GetImageMetadata(this TvDB_ImageWideBanner banner, bool preferred = false)
Expand All @@ -124,7 +124,7 @@ public static string GetFullImagePath(this TvDB_ImageWideBanner banner)
return string.Empty;

var fname = banner.BannerPath.Replace('/', Path.DirectorySeparatorChar);
return Path.Combine(ImageUtils.GetTvDBImagePath(), fname);
return Path.Combine(ImageUtils.GetBaseTvDBImagesPath(), fname);
}

public static IImageMetadata? GetImageMetadata(this AniDB_Character character, bool preferred = false)
Expand Down
19 changes: 0 additions & 19 deletions Shoko.Server/Utilities/ImageUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,16 +85,6 @@ public static string GetBaseTvDBImagesPath()
return dirPath;
}

public static string GetImagesTempFolder()
{
var dirPath = Path.Combine(GetBaseImagesPath(), "_Temp_");

if (!Directory.Exists(dirPath))
Directory.CreateDirectory(dirPath);

return dirPath;
}

public static string GetAniDBCharacterImagePath(int charID)
{
var sid = charID.ToString();
Expand Down Expand Up @@ -128,15 +118,6 @@ public static string GetAniDBImagePath(int animeID)
return dirPath;
}

public static string GetTvDBImagePath()
{
var dirPath = GetBaseTvDBImagesPath();
if (!Directory.Exists(dirPath))
Directory.CreateDirectory(dirPath);

return dirPath;
}

public static IImageMetadata? GetImageMetadata(CL_ImageEntityType imageEntityType, int imageId)
=> GetImageMetadata(imageEntityType.ToServerSource(), imageEntityType.ToServerType(), imageId);

Expand Down

0 comments on commit 8ddc761

Please sign in to comment.