diff --git a/CHANGELOG.md b/CHANGELOG.md index 8dcf2dd..1813cfb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.7.2 +- Export Closed Captions Members. +- Fix #86 + ## 1.7.1 - `ClosedCaptionTrackInfo` and it's members are now json serializable. diff --git a/lib/src/videos/closed_captions/closed_caption_client.dart b/lib/src/videos/closed_captions/closed_caption_client.dart index 7112771..cc5443d 100644 --- a/lib/src/videos/closed_captions/closed_caption_client.dart +++ b/lib/src/videos/closed_captions/closed_caption_client.dart @@ -79,8 +79,8 @@ class ClosedCaptionClient { /// Gets the actual closed caption track which is /// identified by the specified metadata. Future get(ClosedCaptionTrackInfo trackInfo) async { - var response = await ClosedCaptionTrackResponse.get( - _httpClient, trackInfo.url); + var response = + await ClosedCaptionTrackResponse.get(_httpClient, trackInfo.url); var captions = response.closedCaptions .where((e) => !e.text.isNullOrWhiteSpace) diff --git a/lib/src/videos/closed_captions/closed_caption_format.dart b/lib/src/videos/closed_captions/closed_caption_format.dart index a64a768..0755e4b 100644 --- a/lib/src/videos/closed_captions/closed_caption_format.dart +++ b/lib/src/videos/closed_captions/closed_caption_format.dart @@ -35,4 +35,4 @@ class ClosedCaptionFormat { /// Map toJson() => _$ClosedCaptionFormatToJson(this); -} \ No newline at end of file +} diff --git a/lib/src/videos/closed_captions/closed_caption_track_info.dart b/lib/src/videos/closed_captions/closed_caption_track_info.dart index fa1d477..d6cb92d 100644 --- a/lib/src/videos/closed_captions/closed_caption_track_info.dart +++ b/lib/src/videos/closed_captions/closed_caption_track_info.dart @@ -31,10 +31,8 @@ class ClosedCaptionTrackInfo extends Equatable { /// Keeping the same format. ClosedCaptionTrackInfo autoTranslate(String lang) { return ClosedCaptionTrackInfo( - url.replaceQueryParameters({'tlang': lang}), - Language(lang, ''), - isAutoGenerated: isAutoGenerated, - format: format); + url.replaceQueryParameters({'tlang': lang}), Language(lang, ''), + isAutoGenerated: isAutoGenerated, format: format); } @override @@ -43,7 +41,6 @@ class ClosedCaptionTrackInfo extends Equatable { @override List get props => [url, language, isAutoGenerated]; - /// factory ClosedCaptionTrackInfo.fromJson(Map json) => _$ClosedCaptionTrackInfoFromJson(json); diff --git a/lib/src/videos/videos.dart b/lib/src/videos/videos.dart index a732b1d..0e85813 100644 --- a/lib/src/videos/videos.dart +++ b/lib/src/videos/videos.dart @@ -3,6 +3,7 @@ /// {@category Videos} library youtube_explode.videos; +export 'closed_captions/closed_captions.dart'; export 'comments/comments.dart'; export 'streams/streams.dart'; export 'video.dart'; diff --git a/pubspec.yaml b/pubspec.yaml index 8a1e7c3..2bc9539 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: youtube_explode_dart description: A port in dart of the youtube explode library. Supports several API functions without the need of Youtube API Key. -version: 1.7.1 +version: 1.7.2 homepage: https://github.com/Hexer10/youtube_explode_dart environment: diff --git a/test/closed_caption_test.dart b/test/closed_caption_test.dart index 99e8ed5..be478be 100644 --- a/test/closed_caption_test.dart +++ b/test/closed_caption_test.dart @@ -1,5 +1,4 @@ import 'package:test/test.dart'; -import 'package:youtube_explode_dart/src/videos/closed_captions/closed_caption_format.dart'; import 'package:youtube_explode_dart/youtube_explode_dart.dart'; void main() { diff --git a/test/video_test.dart b/test/video_test.dart index c8a0be6..5b71ffb 100644 --- a/test/video_test.dart +++ b/test/video_test.dart @@ -32,7 +32,7 @@ void main() { expect(video.thumbnails.highResUrl, isNotEmpty); expect(video.thumbnails.standardResUrl, isNotEmpty); expect(video.thumbnails.maxResUrl, isNotEmpty); - expect(video.keywords, containsAll(['osu', 'mouse'/*, 'rhythm game'*/])); + expect(video.keywords, containsAll(['osu', 'mouse' /*, 'rhythm game'*/])); expect(video.engagement.viewCount, greaterThanOrEqualTo(134)); expect(video.engagement.likeCount, greaterThanOrEqualTo(5)); expect(video.engagement.dislikeCount, greaterThanOrEqualTo(0));