mirror of
https://github.com/gabehf/Fladder.git
synced 2026-03-07 21:48:14 -08:00
feature: Add actions for media segments (#236)
Co-authored-by: PartyDonut <PartyDonut@users.noreply.github.com>
This commit is contained in:
parent
f0414439f3
commit
e4b8a050c7
9 changed files with 155 additions and 23 deletions
|
|
@ -42,6 +42,28 @@ class MediaSegment with _$MediaSegment {
|
|||
bool forceShow(Duration position) => (position - start).inSeconds < (end - start).inSeconds * 0.20;
|
||||
}
|
||||
|
||||
const Map<MediaSegmentType, SegmentSkip> defaultSegmentSkipValues = {
|
||||
MediaSegmentType.commercial: SegmentSkip.askToSkip,
|
||||
MediaSegmentType.preview: SegmentSkip.askToSkip,
|
||||
MediaSegmentType.recap: SegmentSkip.askToSkip,
|
||||
MediaSegmentType.outro: SegmentSkip.askToSkip,
|
||||
MediaSegmentType.intro: SegmentSkip.askToSkip,
|
||||
};
|
||||
|
||||
enum SegmentSkip {
|
||||
none,
|
||||
askToSkip,
|
||||
skip;
|
||||
|
||||
const SegmentSkip();
|
||||
|
||||
String label(BuildContext context) => switch (this) {
|
||||
SegmentSkip.none => context.localized.segmentActionNone,
|
||||
SegmentSkip.askToSkip => context.localized.segmentActionAskToSkip,
|
||||
SegmentSkip.skip => context.localized.segmentActionSkip,
|
||||
};
|
||||
}
|
||||
|
||||
enum MediaSegmentType {
|
||||
unknown,
|
||||
commercial,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue