Skip to content

Commit

Permalink
Merge pull request #106 from RatakondalaArun/fix/lints
Browse files Browse the repository at this point in the history
fix/lints
  • Loading branch information
RatakondalaArun committed Jan 25, 2024
2 parents 9c0dfd2 + 8f41d02 commit f9fadf6
Show file tree
Hide file tree
Showing 51 changed files with 118 additions and 195 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
name: Code Analysis
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.3.4
- uses: actions/checkout@v4.1.1
- uses: axel-op/dart-package-analyzer@v3
id: analysis
with:
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3.5.2
uses: actions/checkout@v4.1.1

- name: Setup Dart SDK
uses: dart-lang/setup-dart@v1.5.0
uses: dart-lang/setup-dart@v1.6.0

- name: ⏬ Get Depdendencies
run: dart pub get
Expand All @@ -40,19 +40,19 @@ jobs:
needs: [publish]
steps:
- name: Checkout
uses: actions/checkout@v3.5.2
uses: actions/checkout@v4.1.1

- name: Setup Dart SDK
uses: dart-lang/setup-dart@v1.5.0
uses: dart-lang/setup-dart@v1.6.0

- name: 🧬 Generate docs
run: dartdoc --output docs
run: dart doc --output docs

- name: 🌳 tree
run: tree

- name: 📢 Publish docs
uses: JamesIves/github-pages-deploy-action@v4.4.1
uses: JamesIves/github-pages-deploy-action@v4.5.0
with:
branch: docs
folder: docs
5 changes: 2 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,17 @@ on:
pull_request:
branches:
- master
- development

jobs:
tests:
name: 🧪 Tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3.5.2
uses: actions/checkout@v4.1.1

- name: Setup Dart SDK
uses: dart-lang/setup-dart@v1.5.0
uses: dart-lang/setup-dart@v1.6.0

- name: ⏬ Install dependencies
run: dart pub get
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# ChangeLog

## 2.2.1

- Fix Lints

## 2.2.0

- Added `include_image_language` option to movie/tv `getDetails`. Thanks to ([@0Franky](https://github.com/0Franky))
Expand Down
2 changes: 1 addition & 1 deletion lib/abs/catagory.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
part of tmdb_api;
part of '../tmdb_api.dart';

/// Base calss of [Category]s
abstract class Category<V extends Version> {
Expand Down
2 changes: 1 addition & 1 deletion lib/abs/version.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
part of tmdb_api;
part of '../tmdb_api.dart';

/// Base class of [Version]s
abstract class Version {
Expand Down
2 changes: 1 addition & 1 deletion lib/logger/logger.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
part of tmdb_api;
part of '../tmdb_api.dart';

///Configure the logs
///
Expand Down
8 changes: 2 additions & 6 deletions lib/models/list_item.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
part of tmdb_api;
part of '../tmdb_api.dart';

class ListItem {
final MediaType mediaType;
Expand Down Expand Up @@ -36,11 +36,7 @@ class ListItem {
///}
///```
Map<String, dynamic> _toMap() {
return {
'media_type': _getMediaType(mediaType),
'media_id': '$mediaId',
'comment': comment
};
return {'media_type': _getMediaType(mediaType), 'media_id': '$mediaId', 'comment': comment};
}

String _getMediaType(MediaType mediaType) {
Expand Down
2 changes: 1 addition & 1 deletion lib/utils/api_keys.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
part of tmdb_api;
part of '../tmdb_api.dart';

class ApiKeys {
final String _apiKeyV3;
Expand Down
20 changes: 3 additions & 17 deletions lib/utils/enums.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
part of tmdb_api;
part of '../tmdb_api.dart';

//-------------------tmdb_api---------------------
///Http request methods
Expand Down Expand Up @@ -56,23 +56,9 @@ enum SortMoviesBy {
}

//movies.dart
enum SortTvShowsBy {
voteAverageAsc,
voteAverageDesc,
popularityAsc,
popularityDesc,
firstAirDateAsc,
firstAirDateDesc
}
enum SortTvShowsBy { voteAverageAsc, voteAverageDesc, popularityAsc, popularityDesc, firstAirDateAsc, firstAirDateDesc }

enum FilterTvShowsByStatus {
returningSeries,
planned,
inProduction,
ended,
cancelled,
pilot
}
enum FilterTvShowsByStatus { returningSeries, planned, inProduction, ended, cancelled, pilot }

enum FilterTvShowsByType {
documentary,
Expand Down
16 changes: 8 additions & 8 deletions lib/utils/tmdb_exceptions.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
part of tmdb_api;
part of '../tmdb_api.dart';

///Base exception
class TMDBException<T> implements Exception {
Expand All @@ -16,21 +16,21 @@ class TMDBDioError extends TMDBException<DioException> {
final int? statusCode;

const TMDBDioError(
String message, {
required DioException orginal,
super.message, {
required DioException super.orginal,
this.statusCode,
}) : super(message, orginal: orginal);
});

@override
String toString() => 'TMDBDioError(message: $message,orginal:$orginal, statusCode: $statusCode)';
}

class TMDBOtherException extends TMDBException<dynamic> {
const TMDBOtherException(
String message, {
dynamic orginal,
StackTrace? stackTrace,
}) : super(message, orginal: orginal, stackTrace: stackTrace);
super.message, {
super.orginal,
super.stackTrace,
});
@override
String toString() => 'TMDBDioError(message: $message,orginal:$orginal, stackTrace:$stackTrace)';
}
2 changes: 1 addition & 1 deletion lib/versions/v3.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
part of tmdb_api;
part of '../tmdb_api.dart';

class V3 extends Version {
late Movies _movies;
Expand Down
20 changes: 8 additions & 12 deletions lib/versions/v3/category/account.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
part of tmdb_api;
part of '../../../tmdb_api.dart';

class Account extends Category<V3> {
Account(V3 v) : super(v, 'account');
Expand Down Expand Up @@ -153,7 +153,7 @@ class Account extends Category<V3> {
'session_id=$sessionId',
'language=${language ?? _v._tmdb.defaultLanguage}',
'page=$page',
'sort_by=$sort'
'sort_by=$sort',
],
);
}
Expand Down Expand Up @@ -210,7 +210,7 @@ class Account extends Category<V3> {
'session_id=$sessionId',
'language=${language ?? _v._tmdb.defaultLanguage}',
'page=$page',
'sort_by=$sort'
'sort_by=$sort',
],
);
}
Expand Down Expand Up @@ -267,11 +267,7 @@ class Account extends Category<V3> {
'$_endPoint/$accountId/favorite',
method: HttpMethod.post,
optionalQueries: ['session_id=$sessionId'],
postBody: {
'media_type': type,
'media_id': '$mediaId',
'favorite': '$isFavorite'
},
postBody: {'media_type': type, 'media_id': '$mediaId', 'favorite': '$isFavorite'},
);
}
Expand Down Expand Up @@ -395,7 +391,7 @@ class Account extends Category<V3> {
'session_id=$sessionId',
'language=${language ?? _v._tmdb.defaultLanguage}',
'page=$page',
'sort_by=$sort'
'sort_by=$sort',
],
);
}
Expand Down Expand Up @@ -452,7 +448,7 @@ class Account extends Category<V3> {
'session_id=$sessionId',
'language=${language ?? _v._tmdb.defaultLanguage}',
'page=$page',
'sort_by=$sort'
'sort_by=$sort',
],
);
}
Expand Down Expand Up @@ -528,7 +524,7 @@ class Account extends Category<V3> {
'session_id=$sessionId',
'language=${language ?? _v._tmdb.defaultLanguage}',
'page=$page',
'sort_by=$sort'
'sort_by=$sort',
],
);
}
Expand Down Expand Up @@ -605,7 +601,7 @@ class Account extends Category<V3> {
'session_id=$sessionId',
'language=${language ?? _v._tmdb.defaultLanguage}',
'page=$page',
'sort_by=$sort'
'sort_by=$sort',
],
);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/versions/v3/category/authentication.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
part of tmdb_api;
part of '../../../tmdb_api.dart';

class Auth extends Category<V3> {
Auth(V3 v) : super(v, 'authentication');
Expand Down
2 changes: 1 addition & 1 deletion lib/versions/v3/category/certification.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
part of tmdb_api;
part of '../../../tmdb_api.dart';

class Certification extends Category<V3> {
///Provides details about movies
Expand Down
2 changes: 1 addition & 1 deletion lib/versions/v3/category/changes.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
part of tmdb_api;
part of '../../../tmdb_api.dart';

class Changes extends Category<V3> {
///Provides details about movies
Expand Down
2 changes: 1 addition & 1 deletion lib/versions/v3/category/collections.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
part of tmdb_api;
part of '../../../tmdb_api.dart';

class Collections extends Category<V3> {
///Provides details about movies
Expand Down
2 changes: 1 addition & 1 deletion lib/versions/v3/category/companies.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
part of tmdb_api;
part of '../../../tmdb_api.dart';

class Companies extends Category<V3> {
///Provides details about movies
Expand Down
2 changes: 1 addition & 1 deletion lib/versions/v3/category/credit.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
part of tmdb_api;
part of '../../../tmdb_api.dart';

class Credit extends Category<V3> {
///Provides details about movies
Expand Down
2 changes: 1 addition & 1 deletion lib/versions/v3/category/discover.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
part of tmdb_api;
part of '../../../tmdb_api.dart';

class Discover extends Category<V3> {
// final V3 _v;
Expand Down
7 changes: 2 additions & 5 deletions lib/versions/v3/category/find.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
part of tmdb_api;
part of '../../../tmdb_api.dart';

class Find extends Category<V3> {
///Provides details about movies
Expand Down Expand Up @@ -34,10 +34,7 @@ class Find extends Category<V3> {
}) {
return _v._query(
'$_endPoint/$externalId',
optionalQueries: [
_getSourceQuery(externalIdSource),
'language=${language ?? _v._tmdb.defaultLanguage}'
],
optionalQueries: [_getSourceQuery(externalIdSource), 'language=${language ?? _v._tmdb.defaultLanguage}'],
);
}

Expand Down
4 changes: 2 additions & 2 deletions lib/versions/v3/category/genres.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
part of tmdb_api;
part of '../../../tmdb_api.dart';

class Genres extends Category<V3> {
///Provides details about gemres
Expand Down Expand Up @@ -72,5 +72,5 @@ class Genres extends Category<V3> {
}

class Geners extends Genres {
Geners(V3 v) : super(v);
Geners(super.v);
}
8 changes: 4 additions & 4 deletions lib/versions/v3/category/guest_session.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
part of tmdb_api;
part of '../../../tmdb_api.dart';

class GuestSession extends Category<V3> {
///Provides details about movies
Expand Down Expand Up @@ -45,7 +45,7 @@ class GuestSession extends Category<V3> {
optionalQueries: [
'guest_session_id=$guestSessionId',
'language=${language ?? _v._tmdb.defaultLanguage}',
'sort_by=$sort'
'sort_by=$sort',
],
);
}
Expand Down Expand Up @@ -92,7 +92,7 @@ class GuestSession extends Category<V3> {
optionalQueries: [
'guest_session_id=$guestSessionId',
'language=${language ?? _v._tmdb.defaultLanguage}',
'sort_by=$sort'
'sort_by=$sort',
],
);
}
Expand Down Expand Up @@ -139,7 +139,7 @@ class GuestSession extends Category<V3> {
optionalQueries: [
'guest_session_id=$guestSessionId',
'language=${language ?? _v._tmdb.defaultLanguage}',
'sort_by=$sort'
'sort_by=$sort',
],
);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/versions/v3/category/images.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// ignore_for_file: constant_identifier_names
part of tmdb_api;
part of '../../../tmdb_api.dart';

class Images {
final String _baseUrl = 'https://image.tmdb.org/t/p';
Expand Down
7 changes: 2 additions & 5 deletions lib/versions/v3/category/keywords.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
part of tmdb_api;
part of '../../../tmdb_api.dart';

class Keywords extends Category<V3> {
///Provides details about movies
Expand Down Expand Up @@ -40,10 +40,7 @@ class Keywords extends Category<V3> {
}) {
return _v._query(
'$_endPoint/$keywordId',
optionalQueries: [
'include_adult=$includeAdult',
'language=${language ?? _v._tmdb.defaultLanguage}'
],
optionalQueries: ['include_adult=$includeAdult', 'language=${language ?? _v._tmdb.defaultLanguage}'],
);
}
}
Loading

0 comments on commit f9fadf6

Please sign in to comment.