Features: - VOD library with movie grouping and version detection - TV show library with season/episode organization - TMDB integration for trending shows and recently aired episodes - Recent releases section with TMDB release date sorting - Watch history tracking with continue watching - Playlist caching (12-hour TTL) for offline support - M3U playlist parsing with XStream API support - Authentication with credential storage Technical: - SwiftUI for tvOS - Actor-based services for thread safety - Persistent caching for playlists, TMDB data, and watch history - KSPlayer integration for video playback Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
39 lines
1.1 KiB
Swift
39 lines
1.1 KiB
Swift
//
|
|
// FavoriteView.swift
|
|
// TracyPlayer
|
|
//
|
|
// Created by kintan on 2023/7/2.
|
|
//
|
|
|
|
import SwiftUI
|
|
|
|
struct FavoriteView: View {
|
|
@EnvironmentObject
|
|
private var appModel: APPModel
|
|
@State
|
|
private var nameFilter: String = ""
|
|
@FetchRequest(
|
|
sortDescriptors: [NSSortDescriptor(keyPath: \MovieModel.name, ascending: true)],
|
|
predicate: NSPredicate(format: "playmodel.isFavorite == YES")
|
|
)
|
|
private var favoritelist: FetchedResults<MovieModel>
|
|
var body: some View {
|
|
ScrollView {
|
|
LazyVGrid(columns: [GridItem(.adaptive(minimum: MoiveView.width))]) {
|
|
let playlist = favoritelist.filter { model in
|
|
var isIncluded = true
|
|
if !nameFilter.isEmpty {
|
|
isIncluded = model.name!.contains(nameFilter)
|
|
}
|
|
return isIncluded
|
|
}
|
|
ForEach(playlist) { model in
|
|
appModel.content(model: model)
|
|
}
|
|
}
|
|
}
|
|
.padding()
|
|
.searchable(text: $nameFilter)
|
|
}
|
|
}
|