tsacdop-podcast-app-android/lib/type/episodebrief.dart

61 lines
1.4 KiB
Dart
Raw Normal View History

import 'dart:ui';
import 'package:audio_service/audio_service.dart';
2020-02-09 13:29:09 +01:00
class EpisodeBrief {
final String title;
final String description;
final int pubDate;
2020-02-09 13:29:09 +01:00
final int enclosureLength;
final String enclosureUrl;
final String feedTitle;
final String primaryColor;
final int liked;
final String downloaded;
final int duration;
final int explicit;
final String imagePath;
final String mediaId;
2020-03-31 18:36:20 +02:00
final int isNew;
final int skipSeconds;
final int downloadDate;
2020-02-09 13:29:09 +01:00
EpisodeBrief(
this.title,
this.enclosureUrl,
this.enclosureLength,
this.pubDate,
this.feedTitle,
this.primaryColor,
this.duration,
this.explicit,
this.imagePath,
2020-07-24 16:10:08 +02:00
this.isNew,
2020-07-23 20:42:25 +02:00
{this.mediaId,
this.liked,
this.downloaded,
this.skipSeconds,
2020-07-23 20:42:25 +02:00
this.description = '',
this.downloadDate = 0})
: assert(enclosureUrl != null);
MediaItem toMediaItem() {
return MediaItem(
id: mediaId,
title: title,
artist: feedTitle,
album: feedTitle,
duration: Duration.zero,
artUri: 'file://$imagePath',
extras: {'skip': skipSeconds});
}
2020-06-05 20:33:47 +02:00
@override
bool operator ==(Object episode) =>
2020-06-05 20:33:47 +02:00
episode is EpisodeBrief &&
episode.title == title &&
episode.enclosureUrl == enclosureUrl;
@override
int get hashCode => hashValues(enclosureUrl, title);
2020-02-09 13:29:09 +01:00
}