mirror of
https://github.com/gabehf/Fladder.git
synced 2026-03-08 23:18:16 -07:00
Init repo
This commit is contained in:
commit
764b6034e3
566 changed files with 212335 additions and 0 deletions
45
lib/util/track_extensions.dart
Normal file
45
lib/util/track_extensions.dart
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
import 'package:media_kit/media_kit.dart';
|
||||
import 'package:validators/validators.dart';
|
||||
import 'string_extensions.dart';
|
||||
|
||||
extension SubtitleExtension on SubtitleTrack {
|
||||
String get cleanName {
|
||||
final names = {
|
||||
id,
|
||||
title,
|
||||
};
|
||||
return names
|
||||
.where((element) => element != null)
|
||||
.map((e) {
|
||||
if (e == null) return e;
|
||||
if (isNumeric(e)) return '';
|
||||
if (e == "no") {
|
||||
return "Off";
|
||||
}
|
||||
return e.capitalize();
|
||||
})
|
||||
.where((element) => element != null && element.isNotEmpty)
|
||||
.join(" - ");
|
||||
}
|
||||
}
|
||||
|
||||
extension AudioTrackExtension on AudioTrack {
|
||||
String get cleanName {
|
||||
final names = {
|
||||
id,
|
||||
title,
|
||||
};
|
||||
return names
|
||||
.where((element) => element != null)
|
||||
.map((e) {
|
||||
if (e == null) return e;
|
||||
if (isNumeric(e)) return '';
|
||||
if (e == "no") {
|
||||
return "Off";
|
||||
}
|
||||
return e.capitalize();
|
||||
})
|
||||
.where((element) => element != null && element.isNotEmpty)
|
||||
.join(" - ");
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue