mirror of
https://github.com/KRTirtho/spotube.git
synced 2025-09-13 07:55:18 +00:00
27 lines
611 B
Dart
27 lines
611 B
Dart
import 'package:hive/hive.dart';
|
|
|
|
part 'skip_segment.g.dart';
|
|
|
|
@HiveType(typeId: 2)
|
|
class SkipSegment {
|
|
@HiveField(0)
|
|
final int start;
|
|
@HiveField(1)
|
|
final int end;
|
|
SkipSegment(this.start, this.end);
|
|
|
|
static String version = 'v1';
|
|
static final boxName = "oss.krtirtho.spotube.skip_segments.$version";
|
|
static LazyBox<List<SkipSegment>> get box =>
|
|
Hive.lazyBox<List<SkipSegment>>(boxName);
|
|
|
|
SkipSegment.fromJson(Map<String, dynamic> json)
|
|
: start = json['start'],
|
|
end = json['end'];
|
|
|
|
Map<String, dynamic> toJson() => {
|
|
'start': start,
|
|
'end': end,
|
|
};
|
|
}
|