-
-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Undefined array key 1 in SeriesController #1473
Comments
Maybe something like this could work? foreach ($masterserieslist as $s) {
if (preg_match('/^[0-9]/', $s['title'])) {
$thisrange = '0-9';
} else {
preg_match('/([\p{L}\p{N}\p{Katakana}\p{Hiragana}\p{Han}]).*/i', $s['title'], $hits);
$thisrange = strtoupper($hits[1]);
}
$serieslist[$thisrange][] = $s;
}
ksort($serieslist);
$englishRange = range('A', 'Z');
$hiraganaRange = array_map('mb_convert_encoding', range(0x3041, 0x3096), array_fill(0, 0x3096 - 0x3041 + 1, 'UTF-8'));
$katakanaRange = array_map('mb_convert_encoding', range(0x30A1, 0x30F6), array_fill(0, 0x30F6 - 0x30A1 + 1, 'UTF-8'));
$kanjiRange = array_map('mb_convert_encoding', range(0x4E00, 0x9FBF), array_fill(0, 0x9FBF - 0x4E00 + 1, 'UTF-8'));
$mergedRange = array_merge($englishRange, $hiraganaRange, $katakanaRange, $kanjiRange);
$this->smarty->assign('serieslist', $serieslist);
$this->smarty->assign('mergedRange', $mergedRange);
$this->smarty->assign('seriesletter', $letter);
$this->smarty->assign('showname', $showname); |
Perhaps but would focus on specific alphabets I guess. For example I dont know if it works with Cyrillic plus all of the letters it groups Series by are latin A-Z + 0-9 so it would not show up anyway I guess? |
$cyrillicRange = array_map('mb_convert_encoding', range(0x0400, 0x04FF), array_fill(0, 0x04FF - 0x0400 + 1, 'UTF-8')); |
But yeah, this is over complicated and will not yield good results. |
This issue is stale because it has been open for 30 days with no activity. |
This issue was closed because it has been inactive for 14 days since being marked as stale. |
Looks like anything non latin doesn't work right here: https://github.com/NNTmux/newznab-tmux/blob/d25d158ad041be8e371d3d91b10b51ea11f38871/app/Http/Controllers/SeriesController.php#L127C55-L127C55
None of the preg_matches actually work on Chinese of Japanese chars for example.
Can test with this name:
たけし城 (2023)
If you change the regex to use
\w
instead of[A-Z]
it matches but then it still cannot find a corresponding A-Z letter obviously so that's probably not the way to go.One option is to never allow non latin characters in videos table by only picking the english/latin names of shows upon insert (if available) but that won't help existing rows in the table.
Another option is to just ignore I guess:
The text was updated successfully, but these errors were encountered: