Skip to content

Commit

Permalink
Merge branch 'release/3.0.0' into 1212-rename-text-popup
Browse files Browse the repository at this point in the history
  • Loading branch information
youn9k authored Aug 26, 2024
2 parents 19cfa31 + 8ee8086 commit 177a5ab
Show file tree
Hide file tree
Showing 75 changed files with 981 additions and 444 deletions.
2 changes: 1 addition & 1 deletion .github/actions/Auto_close_associate_issue/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ let pattern = /Resolves: #\d+/;
let issueNumber;

try {
issueNumber = body.match(pattern)[0].replace("Resolves: #", "");
issueNumber = body.match(pattern)[0].replace("Resolves: #", "").trim();
} catch {
issueNumber = -1;
}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/AutoCloseIssueByPullRequest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Auto close issue when PR is merged

on:
pull_request_target:
branches-ignore:
- "develop"
types: [closed]
branches:
- "!develop"

jobs:
close-issue:
Expand Down
4 changes: 0 additions & 4 deletions Projects/App/Sources/Application/AppComponent+Base.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ public extension AppComponent {
TextPopupComponent(parent: self)
}

var togglePopUpFactory: any TogglePopUpFactory {
TogglePopUpComponent(parent: self)
}

var containSongsFactory: any ContainSongsFactory {
ContainSongsComponent(parent: self)
}
Expand Down
4 changes: 4 additions & 0 deletions Projects/App/Sources/Application/AppComponent+MyInfo.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,8 @@ extension AppComponent {
var profilePopupFactory: any ProfilePopupFactory {
ProfilePopupComponent(parent: self)
}

var playTypeTogglePopupFactory: any PlayTypeTogglePopupFactory {
PlayTypeTogglePopupComponent(parent: self)
}
}
4 changes: 2 additions & 2 deletions Projects/App/Sources/Application/AppComponent+Playlist.swift
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ public extension AppComponent {
}
}

var fetchWmPlaylistDetailUseCase: any FetchWmPlaylistDetailUseCase {
var fetchWMPlaylistDetailUseCase: any FetchWMPlaylistDetailUseCase {
shared {
FetchWmPlaylistDetailUseCaseImpl(playlistRepository: playlistRepository)
FetchWMPlaylistDetailUseCaseImpl(playlistRepository: playlistRepository)
}
}

Expand Down
5 changes: 5 additions & 0 deletions Projects/App/Support/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -185,5 +185,10 @@
</array>
<key>UIUserInterfaceStyle</key>
<string>Light</string>
<key>LSApplicationQueriesSchemes</key>
<array>
<string>youtube</string>
<string>youtubemusic</string>
</array>
</dict>
</plist>
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public extension ArtistDetailResponseDTO {
let enName: String

private enum CodingKeys: String, CodingKey {
case krName = "krShort"
case krName = "kr"
case enName = "en"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public extension ArtistListResponseDTO {
let enName: String

private enum CodingKeys: String, CodingKey {
case krName = "krShort"
case krName = "kr"
case enName = "en"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import SongsDomainInterface
public protocol RemotePlaylistDataSource {
func fetchRecommendPlaylist() -> Single<[RecommendPlaylistEntity]>
func fetchPlaylistDetail(id: String, type: PlaylistType) -> Single<PlaylistDetailEntity>
func fetchWmPlaylistDetail(id: String) -> Single<WmPlaylistDetailEntity>
func fetchWMPlaylistDetail(id: String) -> Single<WMPlaylistDetailEntity>
func updateTitleAndPrivate(key: String, title: String?, isPrivate: Bool?) -> Completable
func createPlaylist(title: String) -> Single<PlaylistBaseEntity>
func fetchPlaylistSongs(key: String) -> Single<[SongEntity]>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Foundation
import SongsDomainInterface

public struct WmPlaylistDetailEntity: Equatable {
public struct WMPlaylistDetailEntity: Equatable {
public init(
key: String,
title: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import SongsDomainInterface
public protocol PlaylistRepository {
func fetchRecommendPlaylist() -> Single<[RecommendPlaylistEntity]>
func fetchPlaylistDetail(id: String, type: PlaylistType) -> Single<PlaylistDetailEntity>
func fetchWmPlaylistDetail(id: String) -> Single<WmPlaylistDetailEntity>
func fetchWMPlaylistDetail(id: String) -> Single<WMPlaylistDetailEntity>
func updateTitleAndPrivate(key: String, title: String?, isPrivate: Bool?) -> Completable
func createPlaylist(title: String) -> Single<PlaylistBaseEntity>
func fetchPlaylistSongs(key: String) -> Single<[SongEntity]>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import Foundation
import RxSwift

public protocol FetchWMPlaylistDetailUseCase {
func execute(id: String) -> Single<WMPlaylistDetailEntity>
}

This file was deleted.

10 changes: 5 additions & 5 deletions Projects/Domains/PlaylistDomain/Sources/API/PlaylistAPI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import PlaylistDomainInterface

public enum PlaylistAPI {
case fetchPlaylistDetail(id: String, type: PlaylistType) // 플리 상세 불러오기
case fetchWmPlaylistDetail(id: String) // 왁뮤 플리 상세 불러오기
case fetchWMPlaylistDetail(id: String) // 왁뮤 플리 상세 불러오기
case updateTitleAndPrivate(key: String, title: String?, isPrivate: Bool?) // title and private 업데이트
case createPlaylist(title: String) // 플리 생성
case fetchPlaylistSongs(key: String) // 전체 재생 시 곡 데이터만 가져오기
Expand Down Expand Up @@ -36,7 +36,7 @@ extension PlaylistAPI: WMAPI {
case let .fetchPlaylistDetail(id: id, type: type):
return "/\(id)"

case let .fetchWmPlaylistDetail(id: id):
case let .fetchWMPlaylistDetail(id: id):
return "/recommend/\(id)"

case let .updateTitleAndPrivate(key: key, _, _):
Expand Down Expand Up @@ -64,7 +64,7 @@ extension PlaylistAPI: WMAPI {

public var method: Moya.Method {
switch self {
case .fetchRecommendPlaylist, .fetchPlaylistDetail, .fetchWmPlaylistDetail, .fetchPlaylistSongs,
case .fetchRecommendPlaylist, .fetchPlaylistDetail, .fetchWMPlaylistDetail, .fetchPlaylistSongs,
.checkSubscription,
.requestPlaylistOwnerID:
return .get
Expand All @@ -85,7 +85,7 @@ extension PlaylistAPI: WMAPI {

public var task: Moya.Task {
switch self {
case .fetchRecommendPlaylist, .fetchPlaylistDetail, .fetchWmPlaylistDetail, .fetchPlaylistSongs,
case .fetchRecommendPlaylist, .fetchPlaylistDetail, .fetchWMPlaylistDetail, .fetchPlaylistSongs,
.subscribePlaylist, .checkSubscription,
.requestPlaylistOwnerID:
return .requestPlain
Expand Down Expand Up @@ -125,7 +125,7 @@ extension PlaylistAPI: WMAPI {

public var jwtTokenType: JwtTokenType {
switch self {
case .fetchRecommendPlaylist, .fetchWmPlaylistDetail:
case .fetchRecommendPlaylist, .fetchWMPlaylistDetail:
return .none

case let .fetchPlaylistDetail(_, type):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ public final class RemotePlaylistDataSourceImpl: BaseRemoteDataSource<PlaylistAP
.map { $0.toDomain() }
}

public func fetchWmPlaylistDetail(id: String) -> Single<WmPlaylistDetailEntity> {
request(.fetchWmPlaylistDetail(id: id))
.map(WmPlaylistDetailResponseDTO.self)
public func fetchWMPlaylistDetail(id: String) -> Single<WMPlaylistDetailEntity> {
request(.fetchWMPlaylistDetail(id: id))
.map(WMPlaylistDetailResponseDTO.self)
.map { $0.toDomain() }
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ public final class PlaylistRepositoryImpl: PlaylistRepository {
remotePlaylistDataSource.fetchPlaylistDetail(id: id, type: type)
}

public func fetchWmPlaylistDetail(id: String) -> Single<WmPlaylistDetailEntity> {
remotePlaylistDataSource.fetchWmPlaylistDetail(id: id)
public func fetchWMPlaylistDetail(id: String) -> Single<WMPlaylistDetailEntity> {
remotePlaylistDataSource.fetchWMPlaylistDetail(id: id)
}

public func updateTitleAndPrivate(key: String, title: String?, isPrivate: Bool?) -> Completable {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import PlaylistDomainInterface
import SongsDomain
import SongsDomainInterface

public struct WmPlaylistDetailResponseDTO: Decodable {
public struct WMPlaylistDetailResponseDTO: Decodable {
public let key: String?
public let title: String
public let songs: [SingleSongResponseDTO]?
Expand All @@ -19,9 +19,9 @@ public struct WmPlaylistDetailResponseDTO: Decodable {
}
}

public extension WmPlaylistDetailResponseDTO {
func toDomain() -> WmPlaylistDetailEntity {
WmPlaylistDetailEntity(
public extension WMPlaylistDetailResponseDTO {
func toDomain() -> WMPlaylistDetailEntity {
WMPlaylistDetailEntity(
key: key ?? "",
title: title,
songs: (songs ?? []).map { $0.toDomain() },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Foundation
import PlaylistDomainInterface
import RxSwift

public struct FetchWmPlaylistDetailUseCaseImpl: FetchWmPlaylistDetailUseCase {
public struct FetchWMPlaylistDetailUseCaseImpl: FetchWMPlaylistDetailUseCase {
private let playlistRepository: any PlaylistRepository

public init(
Expand All @@ -11,7 +11,7 @@ public struct FetchWmPlaylistDetailUseCaseImpl: FetchWmPlaylistDetailUseCase {
self.playlistRepository = playlistRepository
}

public func execute(id: String) -> Single<WmPlaylistDetailEntity> {
playlistRepository.fetchWmPlaylistDetail(id: id)
public func execute(id: String) -> Single<WMPlaylistDetailEntity> {
playlistRepository.fetchWMPlaylistDetail(id: id)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,19 @@ public struct PlaylistEntity: Equatable {
image: String,
songCount: Int,
userId: String,
private: Bool,
isSelected: Bool = false
) {
self.key = key
self.title = title
self.image = image
self.private = `private`
self.isSelected = isSelected
self.songCount = songCount
self.userId = userId
}

public let key, title, image, userId: String
public let songCount: Int
public var isSelected: Bool
public var `private`, isSelected: Bool
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public struct PlaylistResponseDTO: Decodable {
public let user: PlaylistResponseDTO.User
public let imageUrl: String
public let songCount: Int
public let `private`: Bool

public struct User: Decodable {
public let handle: String
Expand All @@ -30,7 +31,8 @@ public extension PlaylistResponseDTO {
title: title,
image: imageUrl,
songCount: songCount,
userId: user.handle
userId: user.handle,
private: `private`
)
}
}
29 changes: 25 additions & 4 deletions Projects/Domains/UserDomain/Testing/FetchPlaylistUseCaseStub.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,36 @@ import UserDomainInterface

public struct FetchPlaylistUseCaseStub: FetchPlaylistUseCase {
let items: [PlaylistEntity] = [
.init(key: "123", title: "우중충한 장마철 여름에 듣기 좋은 일본 시티팝 플레이리스트", image: "", songCount: 0, userId: ""),
.init(key: "1234", title: "비내리는 도시, 세련된 무드 감각적인 팝송☔️ 분위기 있는 노래 모음", image: "", songCount: 1, userId: ""),
.init(key: "1424", title: "[𝐏𝐥𝐚𝐲𝐥𝐢𝐬𝐭] 여름 밤, 퇴근길에 꽂는 플레이리스트🚃", image: "", songCount: 200, userId: ""),
.init(
key: "123",
title: "우중충한 장마철 여름에 듣기 좋은 일본 시티팝 플레이리스트",
image: "",
songCount: 0,
userId: "",
private: true
),
.init(
key: "1234",
title: "비내리는 도시, 세련된 무드 감각적인 팝송☔️ 분위기 있는 노래 모음",
image: "",
songCount: 1,
userId: "",
private: true
),
.init(
key: "1424",
title: "[𝐏𝐥𝐚𝐲𝐥𝐢𝐬𝐭] 여름 밤, 퇴근길에 꽂는 플레이리스트🚃",
image: "",
songCount: 200,
userId: "",
private: false
),
.init(
key: "1324",
title: "𝐏𝐥𝐚𝐲𝐥𝐢𝐬𝐭 벌써 여름이야? 내 방을 청량한 캘리포니아 해변으로 신나는 여름 팝송 𝐒𝐮𝐦𝐦𝐞𝐫 𝐢𝐬 𝐜𝐨𝐦𝐢𝐧𝐠 🌴",
image: "",
songCount: 1000,
userId: ""
userId: "", private: true
)
]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,27 +51,27 @@ class ArtistDetailHeaderViewController: UIViewController, ViewControllerFromStor
extension ArtistDetailHeaderViewController {
func update(model: ArtistEntity) {
self.model = model
let artistName: String = model.krName
let artistEngName: String = model.enName.capitalizingFirstLetter
let artistKrName: String = model.krName
let artistEnName: String = model.enName
let artistNameAttributedString = NSMutableAttributedString(
string: artistName + " " + artistEngName,
string: artistKrName + " " + artistEnName,
attributes: [
.font: DesignSystemFontFamily.Pretendard.bold.font(size: 24),
.foregroundColor: DesignSystemAsset.BlueGrayColor.gray900.color,
.kern: -0.5
]
)

let artistNameRange = (artistNameAttributedString.string as NSString).range(of: artistName)
let artistEngNameRange = (artistNameAttributedString.string as NSString).range(of: artistEngName)
let artistKrNameRange = (artistNameAttributedString.string as NSString).range(of: artistKrName)
let artistEnNameRange = (artistNameAttributedString.string as NSString).range(of: artistEnName)

artistNameAttributedString.addAttributes(
[
.font: DesignSystemFontFamily.Pretendard.light.font(size: 14),
.foregroundColor: DesignSystemAsset.BlueGrayColor.gray900.color.withAlphaComponent(0.6),
.kern: -0.5
],
range: artistEngNameRange
range: artistEnNameRange
)

let margin: CGFloat = 104.0
Expand All @@ -83,7 +83,7 @@ extension ArtistDetailHeaderViewController {

artistNameAttributedString.addAttributes(
[.font: DesignSystemFontFamily.Pretendard.bold.font(size: availableWidth >= artistNameWidth ? 24 : 20)],
range: artistNameRange
range: artistKrNameRange
)

self.artistNameLabelHeight.constant =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,9 @@ extension ArtistMusicContentViewController: ArtistMusicCellDelegate {
.first(where: { $0.songID == id })
else { return }
PlayState.shared.append(item: .init(id: tappedSong.songID, title: tappedSong.title, artist: tappedSong.artist))
songDetailPresenter.present(id: id)
let playlistIDs = PlayState.shared.currentPlaylist
.map(\.id)
songDetailPresenter.present(ids: playlistIDs, selectedID: tappedSong.songID)
}
}

Expand Down
Loading

0 comments on commit 177a5ab

Please sign in to comment.