Skip to content

Commit 94dbac6

Browse files
committed
Reformat code prior to publishing.
1 parent bee36af commit 94dbac6

File tree

3 files changed

+33
-31
lines changed

3 files changed

+33
-31
lines changed

lib/src/feed/feed.dart

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ class Feed {
5252
final timeout = const Duration(seconds: 20),
5353
String userAgent = '',
5454
}) async {
55-
return _loadFeedInternal(url: url, etag: etag, timeout: timeout, userAgent: userAgent);
55+
return _loadFeedInternal(
56+
url: url, etag: etag, timeout: timeout, userAgent: userAgent);
5657
}
5758

5859
static Future<Podcast> loadFeedFile({required String file}) async {
@@ -199,11 +200,11 @@ class Feed {
199200
case DioExceptionType.connectionError:
200201
throw PodcastFailedException(statusCode, e.message ?? '');
201202
case DioExceptionType.badResponse:
202-
if (statusCode == 304) {
203-
throw PodcastNotChangedException(statusCode, e.message ?? '');
204-
} else {
205-
throw PodcastFailedException(statusCode, e.message ?? '');
206-
}
203+
if (statusCode == 304) {
204+
throw PodcastNotChangedException(statusCode, e.message ?? '');
205+
} else {
206+
throw PodcastFailedException(statusCode, e.message ?? '');
207+
}
207208
case DioExceptionType.badCertificate:
208209
throw PodcastCertificateException(statusCode, e.message ?? '');
209210
case DioExceptionType.cancel:
@@ -235,7 +236,8 @@ class Feed {
235236
if (response.statusCode == 200) {
236237
_loadChapters(response, chapters);
237238
} else {
238-
throw PodcastFailedException(response.statusCode ?? 0, 'Failed to download chapters file');
239+
throw PodcastFailedException(
240+
response.statusCode ?? 0, 'Failed to download chapters file');
239241
}
240242
} on DioException catch (e) {
241243
int statusCode = e.response?.statusCode ?? 0;
@@ -284,9 +286,8 @@ class Feed {
284286
);
285287

286288
try {
287-
final response = headOnly
288-
? await client.head(url)
289-
: await client.get(url);
289+
final response =
290+
headOnly ? await client.head(url) : await client.get(url);
290291

291292
DateTime? lastUpdated;
292293
String etag = '';
@@ -352,7 +353,8 @@ class Feed {
352353
}
353354
}
354355

355-
static Podcast _loadFeed(RssFeed rssFeed, String url, String etag, DateTime? lastUpdtaed) {
356+
static Podcast _loadFeed(
357+
RssFeed rssFeed, String url, String etag, DateTime? lastUpdtaed) {
356358
// Parse the episodes
357359
var episodes = <Episode>[];
358360
var remoteItems = <RemoteItem>[];

lib/src/model/search_result.dart

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,18 +46,18 @@ class SearchResult {
4646
final DateTime processedTime;
4747

4848
SearchResult({this.resultCount = 0, this.items = const <Item>[]})
49-
: successful = true,
50-
lastError = '',
51-
lastErrorType = ErrorType.none,
52-
processedTime = DateTime.now();
49+
: successful = true,
50+
lastError = '',
51+
lastErrorType = ErrorType.none,
52+
processedTime = DateTime.now();
5353

5454
SearchResult.fromError({
5555
this.lastError = '',
5656
this.lastErrorType = ErrorType.none,
57-
}) : successful = false,
58-
resultCount = 0,
59-
processedTime = DateTime.now(),
60-
items = [];
57+
}) : successful = false,
58+
resultCount = 0,
59+
processedTime = DateTime.now(),
60+
items = [];
6161

6262
factory SearchResult.fromJson({
6363
required dynamic json,

lib/src/search/itunes_search.dart

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -71,18 +71,18 @@ final class ITunesSearch extends BaseSearch {
7171
String? userAgent;
7272

7373
ITunesSearch({this.timeout = 20000, this.userAgent})
74-
: _client = Dio(
75-
BaseOptions(
76-
responseType: ResponseType.plain,
77-
connectTimeout: Duration(milliseconds: timeout),
78-
receiveTimeout: Duration(milliseconds: timeout),
79-
headers: {
80-
'User-Agent': userAgent == null || userAgent.isEmpty
81-
? podcastSearchAgent
82-
: userAgent,
83-
},
84-
),
85-
);
74+
: _client = Dio(
75+
BaseOptions(
76+
responseType: ResponseType.plain,
77+
connectTimeout: Duration(milliseconds: timeout),
78+
receiveTimeout: Duration(milliseconds: timeout),
79+
headers: {
80+
'User-Agent': userAgent == null || userAgent.isEmpty
81+
? podcastSearchAgent
82+
: userAgent,
83+
},
84+
),
85+
);
8686

8787
/// Search iTunes using the term [term]. You can limit the results to
8888
/// podcasts available in a specific country by supplying a [Country] option.

0 commit comments

Comments
 (0)