feat: 최근 들은 콘텐츠 로컬 DB 추가

This commit is contained in:
Yu Sung
2025-07-28 22:34:34 +09:00
parent a73cafa08c
commit 70af4cb3dd
10 changed files with 306 additions and 67 deletions

View File

@@ -16,6 +16,7 @@ struct ContentDetailPlayView: View {
@Binding var isShowPreviewAlert: Bool
@StateObject var contentPlayManager = ContentPlayManager.shared
@StateObject var recentContentViewModel = RecentContentViewModel()
@State private var isRepeat = UserDefaults.bool(forKey: .isContentPlayLoop)
@State private var isEditing = false
@@ -101,6 +102,13 @@ struct ContentDetailPlayView: View {
isPreview: !audioContent.existOrdered && audioContent.price > 0
)
isShowPreviewAlert = true
recentContentViewModel.insertRecentContent(
contentId: Int64(audioContent.contentId),
coverImageUrl: audioContent.coverImageUrl,
title: audioContent.title,
creatorNickname: audioContent.creator.nickname
)
}
}