Skip to content

Commit

Permalink
Rename KaraTime to KaraChunk
Browse files Browse the repository at this point in the history
Signed-off-by: Brian Wo <[email protected]>
  • Loading branch information
brainwo committed Aug 17, 2024
1 parent 00d2ab4 commit 411b687
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions lib/kara.dart
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ Duration? _parseDuration(String duration) {
}
}

KaraTime? _parseTimestamp(String line) {
KaraChunk? _parseTimestamp(String line) {
final split = line.split("-->");

if (split.length != 2) return null;
Expand All @@ -93,7 +93,7 @@ KaraTime? _parseTimestamp(String line) {
String? roman = lyricSplit.elementAtOrNull(2);
String? furigana = lyricSplit.elementAtOrNull(3);

return KaraTime(
return KaraChunk(
start: start,
end: end,
original: original,
Expand Down Expand Up @@ -122,7 +122,7 @@ Kara? parse(String raw) {
Map<String, String> currentTranslation = {};

List<KaraLine> lines = [];
List<KaraTime> time = [];
List<KaraChunk> time = [];

for (final line in raw.split('\n').skip(1)) {
if (line.startsWith("#") || line.isEmpty) continue;
Expand Down Expand Up @@ -183,7 +183,7 @@ Kara? parse(String raw) {
}

if (currentSection.isSongStructure) {
if (_parseTimestamp(line) case KaraTime parsedTimestamp) {
if (_parseTimestamp(line) case KaraChunk parsedTimestamp) {
if (currentStart == null ||
currentEnd == null ||
parsedTimestamp.start < currentStart) {
Expand Down
6 changes: 3 additions & 3 deletions lib/src/line.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ class KaraLine {
final KaraTranslation? translations;
final Duration start;
final Duration end;
final List<KaraTime> time;
final List<KaraChunk> time;
}

class KaraTime {
const KaraTime({
class KaraChunk {
const KaraChunk({
required this.start,
required this.end,
required this.original,
Expand Down

0 comments on commit 411b687

Please sign in to comment.