Skip to content

Commit f12a4f4

Browse files
authored
Merge pull request #624 from Serph91P/fix/nfo-array-to-string-and-cleanup
feat: NFO/STRM improvements - fixes, cleanup, directory rename, and consistent name filtering
2 parents 812c7ba + f4bd63c commit f12a4f4

File tree

9 files changed

+648
-69
lines changed

9 files changed

+648
-69
lines changed

app/Filament/Resources/Channels/ChannelResource.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,9 @@ public static function getTableActions(): array
399399
Grid::make()
400400
->schema(self::getForm(edit: true))
401401
->columns(2),
402-
]),
402+
])
403+
// Refresh table after edit to remove records that no longer match active filters
404+
->after(fn ($livewire) => $livewire->dispatch('$refresh')),
403405
DeleteAction::make()->hidden(fn (Model $record) => ! $record->is_custom),
404406
])->button()->hiddenLabel()->size('sm')->hidden(fn (Model $record) => ! $record->is_custom),
405407
EditAction::make('edit')
@@ -409,6 +411,8 @@ public static function getTableActions(): array
409411
->schema(self::getForm(edit: true))
410412
->columns(2),
411413
])
414+
// Refresh table after edit to remove records that no longer match active filters
415+
->after(fn ($livewire) => $livewire->dispatch('$refresh'))
412416
->button()
413417
->hiddenLabel()
414418
->disabled(fn (Model $record) => $record->is_custom)

app/Filament/Resources/Series/SeriesResource.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,9 @@ public static function getTableActions(): array
268268
return [
269269
ActionGroup::make([
270270
EditAction::make()
271-
->slideOver(),
271+
->slideOver()
272+
// Refresh table after edit to remove records that no longer match active filters
273+
->after(fn ($livewire) => $livewire->dispatch('$refresh')),
272274
Action::make('move')
273275
->label('Move Series to Category')
274276
->schema([

app/Filament/Resources/Vods/VodResource.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,9 @@ public static function getTableActions(): array
501501
Grid::make()
502502
->schema(self::getForm(edit: true))
503503
->columns(2),
504-
]),
504+
])
505+
// Refresh table after edit to remove records that no longer match active filters
506+
->after(fn ($livewire) => $livewire->dispatch('$refresh')),
505507
Action::make('process_vod')
506508
->label('Fetch Metadata')
507509
->icon('heroicon-o-arrow-down-tray')

app/Jobs/SyncSeriesStrmFiles.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,8 @@ private function fetchMetadataForSeries(Series $series, $settings, bool $skipCle
466466
$nfoService = app(NfoService::class);
467467
// Generate tvshow.nfo for the series if NFO generation is enabled
468468
// This should be at the series folder level (or base path if no series folder)
469-
$nfoService->generateSeriesNfo($series, $seriesFolderPath);
469+
// Pass name filter settings for consistent title filtering
470+
$nfoService->generateSeriesNfo($series, $seriesFolderPath, null, $nameFilterEnabled, $nameFilterPatterns);
470471
}
471472

472473
// Cache frequently accessed values to avoid repeated property lookups in the episode loop
@@ -551,9 +552,10 @@ private function fetchMetadataForSeries(Series $series, $settings, bool $skipCle
551552
);
552553

553554
// Generate episode NFO file if enabled (pass mapping for hash optimization)
555+
// Pass name filter settings for consistent title filtering
554556
if ($nfoService) {
555557
$episodeMapping = $mappingCache[$ep->id] ?? null;
556-
$nfoService->generateEpisodeNfo($ep, $series, $filePath, $episodeMapping);
558+
$nfoService->generateEpisodeNfo($ep, $series, $filePath, $episodeMapping, $nameFilterEnabled, $nameFilterPatterns);
557559
}
558560
}
559561

app/Jobs/SyncVodStrmFiles.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,11 @@ public function handle(GeneralSettings $settings): void
288288
// Generate movie NFO file if enabled (pass mapping for hash optimization)
289289
if ($nfoService) {
290290
$channelMapping = $mappingCache[$channel->id] ?? null;
291-
$nfoService->generateMovieNfo($channel, $filePath, $channelMapping);
291+
$nfoOptions = [
292+
'name_filter_enabled' => $nameFilterEnabled,
293+
'name_filter_patterns' => $nameFilterPatterns,
294+
];
295+
$nfoService->generateMovieNfo($channel, $filePath, $channelMapping, $nfoOptions);
292296
}
293297
}
294298

0 commit comments

Comments
 (0)