FedericoHeichou / PizzaReader

A Manga and Comics reader written in Laravel
GNU General Public License v3.0
16 stars 6 forks source link

Cyrillic #57

Closed thefoxcc closed 7 months ago

thefoxcc commented 7 months ago

image Hi, this situation in the search works only in English, how can I add Cyrillic? image in the files .vue changed the text Format: Manga and webtoon to Cyrillic, but after clearing the cache, nothing changed, as well as with adult 18+. image the volume download button does not work the reason why I may be getting 404

FedericoHeichou commented 7 months ago

Hi

image Hi, this situation in the search works only in English, how can I add Cyrillic?

This is the function used to search comics https://github.com/FedericoHeichou/PizzaReader/blob/70609d78225cf5654fe40b4e86d4586ff0157f8e/app/Models/Comic.php#L89-L102

I did this in this way because it replaces automatically symbols to permits research like One Punch Man returning things like One-Punch man or Steins gate can still return Steins;Gate.
Sadly Cyrillic are all detected as symbols. I don't know if there is a way to say "all cyrillic alphabet" with regex, in Latin alphabet you can accomplish this with A-Za-z.
Anyway if you don't want this feature you can replace the first 2 lines of that function with these one (not tested but should work):

    public function scopeSearch($query, $search, $column='name') {
        $comic_name = $search;
        if(strlen($comic_name) > 2) {
            if ($column === 'name') {
                return $query->where(function ($q) use ($comic_name) {
                    $q->where('name', 'LIKE', '%' . $comic_name . '%')->orWhere('alt_titles', 'LIKE', '%' . $comic_name . '%');
                });
            } else {
                return $query->where($column, 'LIKE', '%' . $comic_name . '%');
            }
        } else { // Sorry mom
            return $query->where(DB::raw('1=2'));
        }
    }

Or you can edit it adding something near both lines with A-Za-z to make cyrillic works (the full list of characters is ok but I have totally not idea how many are they)

image in the files .vue changed the text Format: Manga and webtoon to Cyrillic, but after clearing the cache, nothing changed, as well as with adult 18+.

You have to re-build the Vue files.
First you have to install some dependencies if you have not them yet

apt install -y npm

Now enter the project directory and install node.js dependencies

cd /var/www/pizzareader
npm install

Now you can build everything again running

npm run prod

Now if you clear your cache you should see your edits

image the volume download button does not work the reason why I may be getting 404

The name of volume is a bit strange, do you have problems with normal volumes too? This seems a oneshot.
Can you try if you have the same problem with a volume 01, 02, 03 etc of a different serie? Else it could still be a problem with cyrillic... Sadly I only tested it with UTF-8 characters, I'm sorry for those problems

thefoxcc commented 7 months ago

npm run prod

cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --config=node_modules/laravel-mix/setup/webpack.config.js

[webpack-cli] Error: You are using an unsupported version of Node. Please update to at least Node v12.14 at assertSupportedNodeVersion (/var/www/wamanga.ru/node_modules/laravel-mix/src/Engine.js:6:15) at module.exports (/var/www/wamanga.ru/node_modules/laravel-mix/setup/webpack.config.js:7:5) at loadConfigByPath (/var/www/wamanga.ru/node_modules/webpack-cli/lib/webpack-cli.js:1439:37) at process._tickCallback (internal/process/next_tick.js:68:7) at Function.Module.runMain (internal/modules/cjs/loader.js:834:11) at startup (internal/bootstrap/node.js:283:19) at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3) npm ERR! code ELIFECYCLE npm ERR! errno 2 npm ERR! pizzareader@1.0.2 production: cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --config=node_modules/laravel-mix/setup/webpack.config.js npm ERR! Exit status 2 npm ERR! npm ERR! Failed at the pizzareader@1.0.2 production script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in: npm ERR! /root/.npm/_logs/2023-12-04T20_15_33_654Z-debug.log npm ERR! code ELIFECYCLE npm ERR! errno 2 npm ERR! pizzareader@1.0.2 prod: npm run production npm ERR! Exit status 2 npm ERR! npm ERR! Failed at the pizzareader@1.0.2 prod script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in: npm ERR! /root/.npm/_logs/2023-12-04T20_15_33_677Z-debug.log

FedericoHeichou commented 7 months ago

Upgrade your node version https://github.com/nodesource/distributions?tab=readme-ov-file#installation-instructions