Skip to content

Commit

Permalink
Linter fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Hexer10 committed Aug 5, 2023
1 parent 0016834 commit 85ee3e4
Show file tree
Hide file tree
Showing 28 changed files with 63 additions and 13 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 2.0.0+1
- Linter fixes.

## 2.0.0
- BREAKING CHANGE: Required at least dart 3.00
- Fixes for dart3
Expand Down
3 changes: 3 additions & 0 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
include: package:lint/strict.yaml

analyzer:
errors:
invalid_annotation_target: ignore

language:
strict-casts: false

Expand Down
12 changes: 12 additions & 0 deletions build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Read about `build.yaml` at https://pub.dev/packages/build_config
# To update generated code, run `pub run build_runner build`
targets:
$default:
builders:
# The end-user of a builder which applies "source_gen|combining_builder"
# may configure the builder to ignore specific lints for their project
source_gen|combining_builder:
options:
ignore_for_file:
- non_constant_identifier_names
- require_trailing_commas
4 changes: 2 additions & 2 deletions lib/src/reverse_engineering/cipher/cipher_manifest.dart
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,11 @@ final class CipherManifest {
return null;
}
if (calledFuncName == swapFuncName) {
final index = _funcIndexExp.firstMatch(e)?.group(1)?.parseInt();
final index = _funcIndexExp.firstMatch(e)?.group(1).parseInt();
return SwapCipherOperation(index!);
}
if (calledFuncName == spliceFuncName) {
final index = _funcIndexExp.firstMatch(e)?.group(1)?.parseInt();
final index = _funcIndexExp.firstMatch(e)?.group(1).parseInt();
return SpliceCipherOperation(index!);
}
if (calledFuncName == reverseFuncName) {
Expand Down
2 changes: 1 addition & 1 deletion lib/src/reverse_engineering/clients/comments_client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ class _Comment {
late final int? likeCount = _commentRenderer
.get('voteCount')
?.getT<String>('simpleText')
?.parseIntWithUnits();
.parseIntWithUnits();

late final bool isHearted = _commentRenderer
.get('actionButtons')
Expand Down
2 changes: 2 additions & 0 deletions lib/src/reverse_engineering/models/fragment.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/src/reverse_engineering/pages/channel_about_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ class _InitialData extends InitialData {
[];

late final int? viewCount =
content.get('viewCountText')?.getT<String>('simpleText')?.parseInt();
content.get('viewCountText')?.getT<String>('simpleText').parseInt();

late final String? joinDate =
content.get('joinedDateText')?.getList('runs')?[1].getT<String>('text');
Expand Down
2 changes: 1 addition & 1 deletion lib/src/reverse_engineering/pages/channel_upload_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ class _InitialData extends InitialData {
video.get('thumbnail')?.getList('thumbnails')?.last.getT<String>('url') ??
'',
video.get('publishedTimeText')?.getT<String>('simpleText') ?? '',
video.get('viewCountText')?.getT<String>('simpleText')?.parseInt() ?? 0,
video.get('viewCountText')?.getT<String>('simpleText').parseInt() ?? 0,
);
}
}
Expand Down
6 changes: 3 additions & 3 deletions lib/src/reverse_engineering/pages/playlist_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ class _InitialData extends InitialData {
?.getList('stats')
?.elementAtSafe(1)
?.getT<String>('simpleText')
?.parseInt();
.parseInt();

// sidebar.playlistSidebarRenderer.items[0].playlistSidebarPrimaryInfoRenderer.stats
late final int? videoCount = root
Expand All @@ -107,7 +107,7 @@ class _InitialData extends InitialData {
?.getList('runs')
?.firstOrNull
?.getT<String>('text')
?.parseInt();
.parseInt();

late final String? continuationToken =
(videosContent ?? playlistVideosContent)
Expand Down Expand Up @@ -215,5 +215,5 @@ class _Video {
root.get('lengthText')?.getT<String>('simpleText')?.toDuration();

int get viewCount =>
root.get('viewCountText')?.getT<String>('simpleText')?.parseInt() ?? 0;
root.get('viewCountText')?.getT<String>('simpleText').parseInt() ?? 0;
}
2 changes: 1 addition & 1 deletion lib/src/reverse_engineering/pages/search_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ class _InitialData extends InitialData {
?.getList('runs')
?.first
.getT<String>('text')
?.parseInt() ??
.parseInt() ??
-1,
);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/src/search/search_client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class SearchClient {
e.title,
e.author,
ChannelId(e.channelId),
e.uploadDate?.toDateTime(),
e.uploadDate.toDateTime(),
e.uploadDate?.toString(),
null,
e.description,
Expand Down
2 changes: 2 additions & 0 deletions lib/src/videos/closed_captions/closed_caption.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions lib/src/videos/closed_captions/closed_caption_format.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions lib/src/videos/closed_captions/closed_caption_part.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions lib/src/videos/closed_captions/closed_caption_track.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions lib/src/videos/closed_captions/language.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions lib/src/videos/streams/audio_only_stream_info.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions lib/src/videos/streams/bitrate.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions lib/src/videos/streams/filesize.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions lib/src/videos/streams/framerate.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions lib/src/videos/streams/muxed_stream_info.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions lib/src/videos/streams/stream_container.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions lib/src/videos/streams/video_only_stream_info.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions lib/src/videos/streams/video_resolution.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions lib/src/videos/video_client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@ class VideoClient {
watchPage.root
.querySelector('meta[itemprop=uploadDate]')
?.attributes['content']
?.tryParseDateTime(),
.tryParseDateTime(),
playerResponse.videoUploadDate.toString(),
playerResponse.videoPublishDate ??
watchPage.root
.querySelector('meta[itemprop=datePublished]')
?.attributes['content']
?.tryParseDateTime(),
.tryParseDateTime(),
playerResponse.videoDescription,
playerResponse.videoDuration,
ThumbnailSet(videoId.value),
Expand Down
1 change: 1 addition & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ dependencies:
http_parser: ^4.0.0
json_annotation: ^4.5.0
meta: ^1.7.0
source_gen: ^1.4.0
xml: ^6.1.0

dev_dependencies:
Expand Down
3 changes: 2 additions & 1 deletion test/closed_caption_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ void main() {
final manifest = await yt!.videos.closedCaptions.getManifest('qfJthDvcZ08');
final trackInfo = manifest.getByLanguage(
'en',
// ignore: avoid_redundant_argument_values
autoGenerated: false,
); // ignore: avoid_redundant_argument_values
);
final track = await yt!.videos.closedCaptions.get(trackInfo.first);
final caption = track.getByTime(
const Duration(
Expand Down

0 comments on commit 85ee3e4

Please sign in to comment.