ShokoAnime / ShokoServer

Repository for Shoko Server.
https://shokoanime.com/
MIT License
414 stars 75 forks source link

Server - No script available for renamer for [...] #890

Closed Ariane-B closed 1 year ago

Ariane-B commented 3 years ago

VERSION INFORMATION

Server Version: 4.1.0.0 (+ daily from 2021-08-10)

Desktop Version: 4.1.0.0

If you've compiled your own version, please use the last commit you compiled.

LOG FILE

2021-08-10.log

DESCRIPTION

I restarted Shoko Server, which caused it to start rehashing everything. I noticed the logs were full of errors for each file:

2021-08-11T03:58:34.6537253Z
Could not find a valid destination: C:\Users\azma\Videos\Anime\Tensei Shitara Slime Datta Ken (2021 Dai 2 Bu)\[SubsPlease]_That_Time_I_Got_Reincarnated_as_a_Slime_(2021_Part_2)_-_01_(1920x1080_H264)_[1FE9B194].mkv
2021-08-11T03:58:34.6537253Z
System.Exception: *Error: No script available for renamer at Shoko.Server.Renamer.LegacyRenamer.GetFilename(RenameEventArgs args) in D:\a\ShokoServer\ShokoServer\Shoko.Server\Renamer\LegacyRenamer.cs:line 30 at Shoko.Server.RenameFileHelper.GetFilename(SVR_VideoLocal_Place place, String scriptName) in D:\a\ShokoServer\ShokoServer\Shoko.Server\Renamer\RenameFileHelper.cs:line 60 at Shoko.Server.Models.SVR_VideoLocal_Place.RenameFile(Boolean preview, String scriptName) in D:\a\ShokoServer\ShokoServer\Shoko.Server\Models\SVR_VideoLocal_Place.cs:line 65 at Shoko.Server.Models.SVR_VideoLocal_Place.RenameIfRequired() in D:\a\ShokoServer\ShokoServer\Shoko.Server\Models\SVR_VideoLocal_Place.cs:line 535

STEPS TO REPRODUCE

  1. Have a folder set as both source and destination that looks like this: image image
  2. Restart Shoko Server. The server will start hashing.
  3. Look at the logs and see lots of errors.
da3dsoul commented 3 years ago

Screenie your import folder settings

Ariane-B commented 3 years ago

image image

da3dsoul commented 3 years ago

Are you trying to move files or just rename?

Ariane-B commented 3 years ago

I'm not sure. I just want it to organize my folder, and what most of those options do is unclear to me.

What it basically is: qBittorrent downloads anime straight into the folder (the files in the bottom of this screenshot)

image

...and I want them to be organized in a way Jellyfin will understand. I don't really care how. But I supposed "move" is probably somewhat required since Jellyfin has a lot less trouble figuring out what belongs together as a series if they're grouped into subfolders.

...So, I guess, both rename and move so that it makes subfolders? But I don't really know what I'm doing and the interface isn't very explicit so I'm at a loss. To be honest I don't even know what it does exactly that I marked the folder as both source and destination.

da3dsoul commented 3 years ago

Then you want two folders. One is a source. The other is a destination. qbittorrent can get in the way if it's seeding from the folder. I recommend things like deluge's copy on complete plugin to avoid shoko and the torrent client fighting over the files. There may be a similar thing for qbittorrent. Idk I don't use it. The both option for import folders is more meant for custom renamer plugins.

Edit: don't enable Watch for New Files on the destination folder. It may cause weirdness

Ariane-B commented 3 years ago

Thanks for your help! In case someone else has my problem, here's what I did in detail.

Note: Change /c to /k in the command line if you want the console window to remain open even after the copy has ended.

da3dsoul commented 3 years ago

You can also use hardlinks in that case, and the files will only take the space of one copy of the file. Mklink on Windows can do it, I believe

Ariane-B commented 3 years ago

Then qbittorrent and Shoko wouldn't interfere with each other even though they would be using the same file? That's interesting. Less space taken up. The advantage of easier cleanup when the system drive gets full is attractive too.

It really has to be a hard link though? A symbolic link wouldn't do?

da3dsoul commented 3 years ago

Yeah, after it's finished, both only actually read the data itself. Shoko needs to be able to move it, but moving a link won't change the underlying data. libtorrrent just gets locks that can interfere with other things, probably on purpose, as you wouldn't want to seed corrupt files

Ariane-B commented 3 years ago

I tried it manually at first. I created a hardlink like this:

cmd /c mklink /h "%UserProfile%\Videos\anime-downloads-complete\[SubsPlease] Heion Sedai no Idaten-tachi - 05 (1080p) [945D7FEB].mkv" "%UserProfile%\Videos\anime-downloads-raw\[SubsPlease] Heion Sedai no Idaten-tachi - 05 (1080p) [945D7FEB].mkv"

But in the server's logs, it said this:

2021-08-12T22:36:51.4705728Z
New file detected: C:\Users\azma\Videos\anime-downloads-complete\[SubsPlease] Heion Sedai no Idaten-tachi - 05 (1080p) [945D7FEB].mkv: Created
2021-08-12T22:36:51.4705728Z
Found file C:\Users\azma\Videos\anime-downloads-complete\[SubsPlease] Heion Sedai no Idaten-tachi - 05 (1080p) [945D7FEB].mkv
2021-08-12T22:36:57.4584786Z
Could not access file: C:\Users\azma\Videos\anime-downloads-complete\[SubsPlease] Heion Sedai no Idaten-tachi - 05 (1080p) [945D7FEB].mkv
2021-08-12T22:36:57.4584786Z
Ariane-B commented 3 years ago

I manually copied the file into my source folder, and while it did move it, it threw an error in the logs, and seems to have failed at renaming it.

The logs look like this:

2021-08-12T23:50:20.8321073Z
New file detected: C:\Users\azma\Videos\anime-downloads-complete\[SubsPlease] Heion Sedai no Idaten-tachi - 05 (1080p) [945D7FEB].mkv: Created
2021-08-12T23:50:20.8321073Z
Found file C:\Users\azma\Videos\anime-downloads-complete\[SubsPlease] Heion Sedai no Idaten-tachi - 05 (1080p) [945D7FEB].mkv
2021-08-12T23:50:26.8852696Z
Hashing File: C:\Users\azma\Videos\anime-downloads-complete\[SubsPlease] Heion Sedai no Idaten-tachi - 05 (1080p) [945D7FEB].mkv
2021-08-12T23:50:40.3064514Z
Starting Updating STATS for SERIES Heion Sedai no Idaten-tachi - Watched Stats: True, Missing Episodes: True, Update Group Stats: True
2021-08-12T23:50:40.5123898Z
Starting Updating STATS for GROUP Heion Sedai no Idaten-tachi from Top Level (recursively) - Watched Stats: True, Missing Episodes: True, Groups Only: True
2021-08-12T23:50:40.5123898Z
Starting Updating STATS for GROUP Heion Sedai no Idaten-tachi - Watched Stats: True, Missing Episodes: True
2021-08-12T23:50:40.5474352Z
Paused Filesystem Watching
2021-08-12T23:50:40.5474352Z
Moving file from C:\Users\azma\Videos\anime-downloads-complete\[SubsPlease] Heion Sedai no Idaten-tachi - 05 (1080p) [945D7FEB].mkv to C:\Users\azma\Videos\Anime\Heion Sedai no Idaten-tachi\[SubsPlease] Heion Sedai no Idaten-tachi - 05 (1080p) [945D7FEB].mkv
2021-08-12T23:50:40.5605198Z
Unpaused Filesystem Watching
2021-08-12T23:50:40.5605198Z
System.Exception: *Error: No script available for renamer at Shoko.Server.Renamer.LegacyRenamer.GetFilename(RenameEventArgs args) in D:\a\ShokoServer\ShokoServer\Shoko.Server\Renamer\LegacyRenamer.cs:line 30 at Shoko.Server.RenameFileHelper.GetFilename(SVR_VideoLocal_Place place, String scriptName) in D:\a\ShokoServer\ShokoServer\Shoko.Server\Renamer\RenameFileHelper.cs:line 60 at Shoko.Server.Models.SVR_VideoLocal_Place.RenameFile(Boolean preview, String scriptName) in D:\a\ShokoServer\ShokoServer\Shoko.Server\Models\SVR_VideoLocal_Place.cs:line 65 at Shoko.Server.Models.SVR_VideoLocal_Place.RenameIfRequired() in D:\a\ShokoServer\ShokoServer\Shoko.Server\Models\SVR_VideoLocal_Place.cs:line 535
2021-08-12T23:50:40.5925426Z
Processing CommandRequest_AddFileToMyList: [SubsPlease] Heion Sedai no Idaten-tachi - 05 (1080p) [945D7FEB].mkv - 8B4D02B4213AB4AC1A9BD009431C281B - True
2021-08-12T23:50:42.2540057Z
Added File to MyList. File: [SubsPlease] Heion Sedai no Idaten-tachi - 05 (1080p) [945D7FEB].mkv Manual Link: False Watched Locally: False Watched AniDB: False Local State: HDD AniDB State: HDD ReadStates: True ReadWatched Setting: True ReadUnwatched Setting: True
2021-08-12T23:50:42.4246977Z
Starting Updating STATS for SERIES Heion Sedai no Idaten-tachi - Watched Stats: True, Missing Episodes: True, Update Group Stats: True
2021-08-12T23:50:42.6233204Z
Starting Updating STATS for GROUP Heion Sedai no Idaten-tachi from Top Level (recursively) - Watched Stats: True, Missing Episodes: True, Groups Only: True
2021-08-12T23:50:42.6233204Z
Starting Updating STATS for GROUP Heion Sedai no Idaten-tachi - Watched Stats: True, Missing Episodes: True

My folder for that show looks like this currently:

image

Cazzar commented 3 years ago

That error you are mentioning there is simply the fact you have renaming enabled, but the Legacy Renamer that is selected has an empty script.

Are you able to show the renamer section in Shoko Desktop to confirm this?

Ariane-B commented 3 years ago

Found it!

image

So, is that bad? How do I get renaming back to how it was before I split my folders into two?

chocoboSan commented 2 years ago

A bit grave digging on your issue but hoping it may help. I was facing the same problem and it got solved by (on the screen of the screenshot you provided) click save (I also had a checkbox and checked it). Then it could find the script to run !

Weird.

revam commented 1 year ago

Closing this as it seems to be resolved.

@Ariane-B did you ever manage to merge the two split libraries back together, or do you still need help with that? If yes, then we can continue in this issue (but please keep it closed, since it's unrelated to the issue title), continue in a new issue, or hop into the #support channe in discord (if you haven't already received help over there).

Ariane-B commented 1 year ago

It was a while ago and I forgot, but I think it ended up being fine! Well, it works fine these days, so it's probably okay.