Skip to content

Commit

Permalink
Add support for RSS content tag. Remove unused imports.
Browse files Browse the repository at this point in the history
  • Loading branch information
amugofjava committed Feb 20, 2023
1 parent 026b5b7 commit 52d304b
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 35 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.5.2

- Add support for RSS content tag.

## 0.5.1

- Breaking change: Search provider is now passed when instantiating a Search object, rather than passing one at search time.
Expand Down
12 changes: 6 additions & 6 deletions lib/src/exceptions/search_exceptions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@
/// Thrown if the connection times out, or we timeout
/// waiting to receive the data.
class PodcastTimeoutException implements Exception {
final String _message;
final String message;

PodcastTimeoutException(this._message);
PodcastTimeoutException(this.message);
}

/// Thrown if the search is cancelled.
class PodcastCancelledException implements Exception {
final String _message;
final String message;

PodcastCancelledException(this._message);
PodcastCancelledException(this.message);
}

/// Thrown if we get an invalid response error.
class PodcastFailedException implements Exception {
final String _message;
final String message;

PodcastFailedException(this._message);
PodcastFailedException(this.message);
}
4 changes: 4 additions & 0 deletions lib/src/model/episode.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ class Episode {
/// Episode number
int? episode;

/// Content
String? content;

/// Length of the episode as a [Duration].
final Duration? duration;

Expand All @@ -54,6 +57,7 @@ class Episode {
this.imageUrl,
this.season,
this.episode,
this.content,
this.chapters,
});
}
19 changes: 7 additions & 12 deletions lib/src/model/genre.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,18 @@
/// A class that represents the genre(s) the podcast is related to.
class Genre {
/// Genre ID.
final int _id;
final int id;

/// Genre name.
final String _name;
final String name;

Genre(this._id, this._name);

const Genre._(int id, String name)
: _id = id,
_name = name;
const Genre(
this.id,
this.name,
);

@override
String toString() {
return '$_id: $_name';
return '$id: $name';
}

int get id => _id;

String get name => _name;
}
1 change: 0 additions & 1 deletion lib/src/model/item.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// MIT license that can be found in the LICENSE file.

import 'package:podcast_search/podcast_search.dart';
import 'package:podcast_search/src/model/genre.dart';

/// A class that represents an individual Podcast within the search results. Not all
/// properties may contain values for all search providers.
Expand Down
3 changes: 1 addition & 2 deletions lib/src/model/podcast.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ import 'package:dio/dio.dart';
import 'package:podcast_search/podcast_search.dart';
import 'package:podcast_search/src/model/chapter.dart';
import 'package:podcast_search/src/model/chapter_headers.dart';
import 'package:podcast_search/src/model/chapters.dart';
import 'package:podcast_search/src/model/episode.dart';
import 'package:podcast_search/src/model/funding.dart';
import 'package:podcast_search/src/model/locked.dart';
import 'package:podcast_search/src/search/base_search.dart';
Expand Down Expand Up @@ -299,6 +297,7 @@ class Podcast {
imageUrl: item.itunes?.image?.href,
season: item.itunes?.season,
episode: item.itunes?.episode,
content: item.content?.value,
chapters: chapters,
));
});
Expand Down
4 changes: 0 additions & 4 deletions lib/src/search/itunes_search.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ import 'dart:convert';

import 'package:dio/dio.dart';
import 'package:podcast_search/podcast_search.dart';
import 'package:podcast_search/src/model/attribute.dart';
import 'package:podcast_search/src/model/country.dart';
import 'package:podcast_search/src/model/language.dart';
import 'package:podcast_search/src/model/search_result.dart';
import 'package:podcast_search/src/search/base_search.dart';

/// This class handles the searching. Taking the base URL we build any parameters
Expand Down
4 changes: 0 additions & 4 deletions lib/src/search/podcast_index_search.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ import 'package:convert/convert.dart';
import 'package:crypto/crypto.dart';
import 'package:dio/dio.dart';
import 'package:podcast_search/podcast_search.dart';
import 'package:podcast_search/src/model/attribute.dart';
import 'package:podcast_search/src/model/country.dart';
import 'package:podcast_search/src/model/language.dart';
import 'package:podcast_search/src/model/search_result.dart';
import 'package:podcast_search/src/search/base_search.dart';

/// This class handles the searching. Taking the base URL we build any parameters
Expand Down
5 changes: 0 additions & 5 deletions lib/src/search/search.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,8 @@
// MIT license that can be found in the LICENSE file.

import 'package:podcast_search/podcast_search.dart';
import 'package:podcast_search/src/model/attribute.dart';
import 'package:podcast_search/src/model/country.dart';
import 'package:podcast_search/src/model/language.dart';
import 'package:podcast_search/src/model/search_result.dart';
import 'package:podcast_search/src/search/itunes_search.dart';
import 'package:podcast_search/src/search/podcast_index_search.dart';
import 'package:podcast_search/src/search/providers/providers.dart';

/// This class handles the searching. Taking the base URL we build any parameters
/// that have been added before making a call to iTunes. The results are unpacked
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: podcast_search
description: A library for searching for podcasts, parsing podcast RSS feeds and obtaining episodes details. Supports searching via iTunes and PodcastIndex (preview).

version: 0.5.1
version: 0.5.2
homepage: https://github.com/amugofjava/podcast_search

environment:
Expand Down

0 comments on commit 52d304b

Please sign in to comment.