From df0d535d00a4603617c4869c3f3168f849231ccd Mon Sep 17 00:00:00 2001 From: KTH Date: Sat, 31 Aug 2024 17:53:23 +0900 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A5::=20[#1269]=20=EB=AF=B8=EC=82=AC?= =?UTF-8?q?=EC=9A=A9=20=EC=BD=94=EB=93=9C=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Utility/Sources/API/WMImageAPI.swift | 52 +------------------ 1 file changed, 2 insertions(+), 50 deletions(-) diff --git a/Projects/Modules/Utility/Sources/API/WMImageAPI.swift b/Projects/Modules/Utility/Sources/API/WMImageAPI.swift index 55531b8e0..fcb15fad8 100644 --- a/Projects/Modules/Utility/Sources/API/WMImageAPI.swift +++ b/Projects/Modules/Utility/Sources/API/WMImageAPI.swift @@ -1,83 +1,35 @@ -// -// WMImageAPI.swift -// Utility -// -// Created by KTH on 2023/02/10. -// Copyright © 2023 yongbeomkwak. All rights reserved. -// - import Foundation public enum WMImageAPI { - case fetchNewsThumbnail(time: String) - case fetchArtistWithRound(id: String, version: Int) - case fetchArtistWithSquare(id: String, version: Int) - case fetchPlayList(id: String, version: Int) - case fetchRecommendPlaylistWithRound(id: String, version: Int) - case fetchRecommendPlaylistWithSquare(id: String, version: Int) case fetchYoutubeThumbnail(id: String) case fetchYoutubeThumbnailHD(id: String) - case fetchNotice(id: String) } public extension WMImageAPI { var baseURLString: String { - return BASE_IMAGE_URL() - } - - var youtubeBaseURLString: String { return "https://i.ytimg.com" } var path: String { switch self { - case let .fetchNewsThumbnail(time): - return WMDOMAIN_IMAGE_NEWS() + "/\(time).png" - - case let .fetchArtistWithRound(id, version): - return WMDOMAIN_IMAGE_ARTIST_ROUND() + "/\(id).png?v=\(version)" - - case let .fetchArtistWithSquare(id, version): - return WMDOMAIN_IMAGE_ARTIST_SQUARE() + "/\(id).png?v=\(version)" - - case let .fetchPlayList(id, version): - return WMDOMAIN_IMAGE_PLAYLIST() + "/\(id).png?v=\(version)" - - case let .fetchRecommendPlaylistWithSquare(id, version): - return WMDOMAIN_IMAGE_RECOMMEND_PLAYLIST_SQUARE() + "/\(id).png?v=\(version)" - - case let .fetchRecommendPlaylistWithRound(id, version): - return WMDOMAIN_IMAGE_RECOMMEND_PLAYLIST_ROUND() + "/\(id).png?v=\(version)" - case let .fetchYoutubeThumbnail(id): return "vi/\(id)/mqdefault.jpg" case let .fetchYoutubeThumbnailHD(id): return "vi/\(id)/maxresdefault.jpg" - - case let .fetchNotice(id): - return WMDOMAIN_IMAGE_NOTICE() + "/\(id)" } } var toString: String { switch self { - case .fetchYoutubeThumbnail: - return youtubeBaseURLString + "/" + path - case .fetchYoutubeThumbnailHD: - return youtubeBaseURLString + "/" + path - default: + case .fetchYoutubeThumbnail, .fetchYoutubeThumbnailHD: return baseURLString + "/" + path } } var toURL: URL? { switch self { - case .fetchYoutubeThumbnail: - return URL(string: youtubeBaseURLString + "/" + path) - case .fetchYoutubeThumbnailHD: - return URL(string: youtubeBaseURLString + "/" + path) - default: + case .fetchYoutubeThumbnail, .fetchYoutubeThumbnailHD: return URL(string: baseURLString + "/" + path) } }