chore: pre-commit ci hook, dart format
This commit is contained in:
@@ -68,9 +68,9 @@ class DownloadProvider extends ChangeNotifier {
|
||||
final Map<String, SyncRuleItem> _syncRules = {};
|
||||
|
||||
DownloadProvider({required DownloadManagerService downloadManager, required AppDatabase database})
|
||||
: _downloadManager = downloadManager,
|
||||
_database = database,
|
||||
_syncRuleExecutor = SyncRuleExecutor(database: database) {
|
||||
: _downloadManager = downloadManager,
|
||||
_database = database,
|
||||
_syncRuleExecutor = SyncRuleExecutor(database: database) {
|
||||
// Listen to progress updates from the download manager
|
||||
_progressSubscription = _downloadManager.progressStream.listen(_onProgressUpdate);
|
||||
|
||||
@@ -321,10 +321,7 @@ class DownloadProvider extends ChangeNotifier {
|
||||
}
|
||||
|
||||
/// Get episode downloads filtered by show and/or season ratingKey.
|
||||
List<DownloadProgress> _getEpisodeDownloads({
|
||||
String? showRatingKey,
|
||||
String? seasonRatingKey,
|
||||
}) {
|
||||
List<DownloadProgress> _getEpisodeDownloads({String? showRatingKey, String? seasonRatingKey}) {
|
||||
return _downloads.entries
|
||||
.where((entry) {
|
||||
final meta = _metadata[entry.key];
|
||||
@@ -758,8 +755,13 @@ class DownloadProvider extends ChangeNotifier {
|
||||
}
|
||||
|
||||
/// Queue all episodes from a TV show for download
|
||||
Future<int> _queueShowDownload(PlexMetadata show, PlexClient client,
|
||||
{DownloadVersionConfig? versionConfig, DownloadFilter filter = DownloadFilter.all, int? maxCount}) async {
|
||||
Future<int> _queueShowDownload(
|
||||
PlexMetadata show,
|
||||
PlexClient client, {
|
||||
DownloadVersionConfig? versionConfig,
|
||||
DownloadFilter filter = DownloadFilter.all,
|
||||
int? maxCount,
|
||||
}) async {
|
||||
int count = 0;
|
||||
final seasons = await client.getChildren(show.ratingKey);
|
||||
|
||||
@@ -770,8 +772,13 @@ class DownloadProvider extends ChangeNotifier {
|
||||
if (season.type == 'season') {
|
||||
if (remaining != null && remaining <= 0) break;
|
||||
final seasonWithServer = _ensureServerId(season, show.serverId);
|
||||
final queued = await _queueSeasonDownload(seasonWithServer, client,
|
||||
versionConfig: versionConfig, filter: filter, maxCount: remaining);
|
||||
final queued = await _queueSeasonDownload(
|
||||
seasonWithServer,
|
||||
client,
|
||||
versionConfig: versionConfig,
|
||||
filter: filter,
|
||||
maxCount: remaining,
|
||||
);
|
||||
count += queued;
|
||||
if (remaining != null) remaining -= queued;
|
||||
}
|
||||
@@ -781,8 +788,13 @@ class DownloadProvider extends ChangeNotifier {
|
||||
}
|
||||
|
||||
/// Queue all episodes from a season for download
|
||||
Future<int> _queueSeasonDownload(PlexMetadata season, PlexClient client,
|
||||
{DownloadVersionConfig? versionConfig, DownloadFilter filter = DownloadFilter.all, int? maxCount}) async {
|
||||
Future<int> _queueSeasonDownload(
|
||||
PlexMetadata season,
|
||||
PlexClient client, {
|
||||
DownloadVersionConfig? versionConfig,
|
||||
DownloadFilter filter = DownloadFilter.all,
|
||||
int? maxCount,
|
||||
}) async {
|
||||
int count = 0;
|
||||
final episodes = await client.getChildren(season.ratingKey);
|
||||
|
||||
@@ -822,8 +834,11 @@ class DownloadProvider extends ChangeNotifier {
|
||||
}
|
||||
|
||||
/// Queue missing episodes for a show
|
||||
Future<int> _queueMissingShowEpisodes(PlexMetadata show, PlexClient client,
|
||||
{DownloadVersionConfig? versionConfig}) async {
|
||||
Future<int> _queueMissingShowEpisodes(
|
||||
PlexMetadata show,
|
||||
PlexClient client, {
|
||||
DownloadVersionConfig? versionConfig,
|
||||
}) async {
|
||||
int queuedCount = 0;
|
||||
|
||||
final seasons = await client.getChildren(show.ratingKey);
|
||||
@@ -840,8 +855,11 @@ class DownloadProvider extends ChangeNotifier {
|
||||
}
|
||||
|
||||
/// Queue missing episodes for a season
|
||||
Future<int> _queueMissingSeasonEpisodes(PlexMetadata season, PlexClient client,
|
||||
{DownloadVersionConfig? versionConfig}) async {
|
||||
Future<int> _queueMissingSeasonEpisodes(
|
||||
PlexMetadata season,
|
||||
PlexClient client, {
|
||||
DownloadVersionConfig? versionConfig,
|
||||
}) async {
|
||||
int queuedCount = 0;
|
||||
|
||||
final episodes = await client.getChildren(season.ratingKey);
|
||||
|
||||
Reference in New Issue
Block a user