Skip to content

Commit

Permalink
Merge pull request #27 from harlanx:feature/update-and-improve-perfor…
Browse files Browse the repository at this point in the history
…mance

feat: Update tools and improve performance
  • Loading branch information
harlanx committed Sep 3, 2023
2 parents b2c266b + 42ba986 commit 426c445
Show file tree
Hide file tree
Showing 7 changed files with 95 additions and 90 deletions.
Binary file modified assets/mediainfo/MediaInfo.dll
Binary file not shown.
Binary file modified assets/mediainfo/MediaInfo.exe
Binary file not shown.
Binary file modified assets/mkvmerge/mkvmerge.exe
Binary file not shown.
4 changes: 3 additions & 1 deletion lib/screens/home/home_screen_menu.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import 'dart:async';

import 'package:fluent_ui/fluent_ui.dart';

import 'package:file_selector/file_selector.dart';
Expand Down Expand Up @@ -105,6 +107,6 @@ class HomeScreenMenuBar extends StatelessWidget {
final shows = context.read<ShowListNotifier>();
final paths = await getDirectoryPaths();

await shows.add(paths);
unawaited(shows.add(paths));
}
}
19 changes: 11 additions & 8 deletions lib/services/file_grouper.dart
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,10 @@ class FileGrouper {
static Future<int?> _fetchSeason(String text) async {
int? result;
// Extract the season string
final seasonPattern =
RegExp(r'Season.\d+|S.\d+|Season \d+|S \d+', caseSensitive: false);
final seasonPattern = RegExp(
r'Season.\d+|S.\d+|Season \d+|S \d+',
caseSensitive: false,
);
final seasonMatch = seasonPattern.stringMatch(text);
if (seasonMatch != null) {
// Extract the season number
Expand All @@ -200,14 +202,15 @@ class FileGrouper {
static Future<int?> _fetchEpisode(String text) async {
int? result;
// Extract the episode string
final seasonPattern = RegExp(
r'Episode.\d+|E.\d+|Episode \d+|E \d+|\b\d{2}\b',
caseSensitive: false);
final seasonMatch = seasonPattern.stringMatch(text);
if (seasonMatch != null) {
final episodePattern = RegExp(
r'Episode.\d+|E.\d+|Episode \d+|E \d+|(?<!Season\s|S\s)-?\b\d{2}\b',
caseSensitive: false,
);
final episodeMatch = episodePattern.stringMatch(text);
if (episodeMatch != null) {
// Extract the season number
final numberPattern = RegExp(r'\d+', caseSensitive: false);
final numberMatch = numberPattern.stringMatch(seasonMatch);
final numberMatch = numberPattern.stringMatch(episodeMatch);
if (numberMatch != null) {
// Parse season number string to int
result = int.parse(numberMatch);
Expand Down
Loading

0 comments on commit 426c445

Please sign in to comment.