mirror of
https://github.com/R0m1k3/xtremflow.git
synced 2026-10-21 14:08:04 +02:00
fix: add Dart-pure PlaylistConfig for server and fix imports
This commit is contained in:
1 parent
3486e15334
commit
01d522613f
3 files changed
+270
-188
No files matched your search
@@ -0,0 +1,52 @@
|
||||
/// Pure Dart model for Xtream Codes playlist configuration
|
||||
/// This is a server-side copy without Hive/Equatable dependencies
|
||||
class PlaylistConfig {
|
||||
final String id;
|
||||
final String name;
|
||||
|
||||
/// Xtream server URL (without trailing slash)
|
||||
final String dns;
|
||||
|
||||
final String username;
|
||||
|
||||
/// Xtream password
|
||||
final String password;
|
||||
|
||||
final DateTime createdAt;
|
||||
|
||||
final bool isActive;
|
||||
|
||||
const PlaylistConfig({
|
||||
required this.id,
|
||||
required this.name,
|
||||
required this.dns,
|
||||
required this.username,
|
||||
required this.password,
|
||||
required this.createdAt,
|
||||
this.isActive = true,
|
||||
});
|
||||
|
||||
/// Creates a copy of this playlist with updated fields
|
||||
PlaylistConfig copyWith({
|
||||
String? id,
|
||||
String? name,
|
||||
String? dns,
|
||||
String? username,
|
||||
String? password,
|
||||
DateTime? createdAt,
|
||||
bool? isActive,
|
||||
}) {
|
||||
return PlaylistConfig(
|
||||
id: id ?? this.id,
|
||||
name: name ?? this.name,
|
||||
dns: dns ?? this.dns,
|
||||
username: username ?? this.username,
|
||||
password: password ?? this.password,
|
||||
createdAt: createdAt ?? this.createdAt,
|
||||
isActive: isActive ?? this.isActive,
|
||||
);
|
||||
}
|
||||
|
||||
/// Generate Xtream API base URL
|
||||
String get apiBaseUrl => '$dns/player_api.php';
|
||||
}
|
||||
Reference in new issue
Block a user