-
-
Notifications
You must be signed in to change notification settings - Fork 21
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
Add library import #22
Comments
Agreed. I have 11k comics and would take forever to pull them all in individually. Once import is implemented Kapowarr will be a much needed app to replace Mylar. |
Not sure if this would be a separate issue or considered part of the import process, but options to move or hardlink imported files are a must for me as I'm also getting files from DC++ and they freak out when anything is tagged incorrectly |
Why would Kapowarr move imported files? It scans the volume folder and links any found files to the issues of the volume, just like in Sonarr. Where in this process would anything be moved? |
Kapowarr currently doesn't download torrents. |
I understand, but I assume at some point you'll also support torrents or DC++, and in either case I'd want some options to define move, copy, or hardlink from the download location. Just throwing it out there as it relates to importing. |
I'm going to start working on this feature, but I have a functional problem that I first have to decide on before I can start. I would like to get some input from you people on how the following should work. Kapowarr will find all files that aren't already mapped and then tries to find the CV volume that the file is for. The user can then change this if the volume found by Kapowarr is not the correct one. All good up to that point. But then comes the importing, the moment that the files are actually imported into Kapowarr. When importing a file for which the volume isn't already added, should the volume folder of the volume be set to a custom folder: the folder that the file is in? Or should the volume folder just be the auto-generated folder and the file be moved into that folder? The chance that the folder names are exactly the same as the format, is pretty small. So either the volume folder needs to become that folder, or the files inside it need to be moved to the volume folder that is auto-generated. The problem with setting the volume folder as the folder of the file is that it's hard to know if that's the correct folder. It could be that all files of all volumes are in the same folder. Or that each file is in it's own subfolder, leading to problems when the next issue is imported and confusion about what should be the volume folder arises. The problem with moving the files into the auto-generated volume folder is that a "graveyard" of empty folders is left behind from all the old folders that the media was in. And your complete folder structure is deleted and re-organised by Kapowarr immediately. So what do you people think? How should Kapowarr handle this? |
Yes, I think so. A future feature could be a button to reorganize the files into a better named folder, similar to how Sonarr and Radarr have a "reorganize" button. I believe that it's better to leave the files organized by the user's specs than to move them unexpectedly. |
@Jacob-Lasky but then it's hard for Kapowarr to determine what the volume folder should be. Should Kapowarr just use the folder that the file is in as the volume folder? Or the highest folder that references the volume number (e.g. the grandparent folder is "Volume 1/" and that's the highest folder giving the volume number, so that should be the one)? What if a file is found that also maps to the volume, but is in a different folder? |
The only issue is hardlinks can cause pain if you move storage locations (or hosts). They're also handled differently in Windows vs 'nix - so storage backends behaving weirdly becomes a possibility. It's hard to use them in a cross-platform scenario. With sonarr, there's an option to manually match the series when you go to import - and then an option to import and rename them. I'd say if we store a filename/path against an issue we can manually map a file as 'available', and then be able to rename/move/organise with a button afterwards. |
I'd argue that moving storage/hosts is probably not a very common occurrence, but overall I see your point and agree that it's not perfect for everyone. A config option to support either one as noted above would cover everyone's use case |
It's not common, sure, but for anyone only just getting into automating things it's enough of an annoyance to consider. I know a number of people test with windows/truenas/unraid/linux/etc before settling into the one that suits them, so not considering that would be remiss (I feel). |
Okay how about the following: Group all files together that link to the same volume (e.g. files for issue 1, 2, etc.), and set the volume folder as the lowest common folder. If the volume linked already exists, ignore the file. Because it means that the file is for a volume but that volume doesn't match it, making it pop up in library import. That means that either the file is not for the volume (so in library import it shouldn't be matched to that volume either), or it's in a different folder outside the volume folder. Kapowarr doesn't move files on library import and volumes can't have multiple volume folders, so no way to fix the situation, so ignore it. |
Ill add 500 EUR bonus if my library gets imported correctly. I'd like for Kapowarr to rename and move my folders and files. And remove the graveyard of leftover folders (if empty recursively). As long as we have manual overrides or choices during the import. Maybe make a in limbo/in purgatory option for folders/files not able to match. |
How is it not being imported correctly? What's happening?
So basically library import and after that immediately trigger a rename for all volumes that were imported and their files?
When you load the "proposal", you can edit the matches for the files before "committing". You can edit it for each file seperatly or for all files in one go that seem to be for the same volume. Is that sufficient? |
Sorry Casvt, i wasnt up to date. Didnt know this functionality was implemented. Awesome work! I will check what happens with my library and let you know. |
Am i seeing correctly that the dockerhub isnt updated yet? |
The feature is not released yet. In order to try it out, you'd have to clone the dev branch of the repo, build a container locally from that clone and run that container. |
I added an "Import and rename" button. It does exactly what it says it does :) |
I hear. I would think most people would use the |
Never mind about |
How do you have access to the library import? I'm literally working right now on pushing an alpha release. Edit: Available at |
Ah thanks, I will pull that one in. See it works! |
If not, please check the logs for any errors. 229 folders is a lot and will probably hit the rate limit of CV. Try importing only a few folders first and see if that works. If it does, you can try everything else in one go. If it then doesn't, it's probably the rate limit. Share the error from the logs if any appears so that I can add handling of the rate limit in the right place. |
I see a lot of matching being done in console, and an error at the end. Where is the log saved? |
The log is just the console. It's not saved to a file. Could you share the error you see with a few lines before it too? |
|
If I can guess I think the import processed a few hundred files before this error. Maybe it should already save those processed ones and skip them on next run? |
Yeah that's the plan. It keeps going until it hits the rate limit and then just handles that batch and leaves the others for next time. |
Odd thing is, I can restart the import immediately and it runs again and halts at same position. It might not even reach the limit with my library. So is it a rate limit or real json error. When the "Refresh and Scan" button is pressed on a volume we get a nice feedback icon until error or finish. Would be great to have the refresh button do the same in import library. Im sure you will add that, but it will save a lot of pulling hairs ;). |
Probably because in between running, the limit "cools down". Then when you start it again, it will limit again after the same amount of requests, which would be the same volume/"position".
229 folders will for sure reach the limit. Especially when Kapowarr makes the requests so fast (asynchronously). The limit is 200 requests per hour. However, in my experience you can easily surpass that without problem. Most of the rate limiting happens for the velocity at which you make the requests. As long as you don't make them too fast after each other, you can make as many requests per hour as you want. Kapowarr makes the requests asynchronously (for speed improvements), but that also triggers the limiter quite fast. But luckily after like 1 minute it's already off and you can request again.
Normally when the rate limit is reached, there is still json returned, but the status code in the output is set to 107 for "Rate limit reached". However, someone else encountered a similar problem where instead of the 107 being returned, CV returns HTML for some reason. But it still meant that the limit was reached. So I added handling for the synchronous fetching of the API to also stop when HTML is returned. But I didn't add that handling to the asynchronous fetching of the API (which LI uses).
Sure New alpha release available at |
|
BTW, I also get this error when refreshing an existing volume:
|
Your computer suddenly can't resolve the domain of CV (DNS problems). This doesn't have to do with Kapowarr as far as I know. Can you reach https://comicvine.gamespot.com in your browser? |
Yes I can, maybe comicvine throttled my connection. A catch for this (edge?) case might be a good idea though. |
Yeah I could just say if we can't resolve, treat it as if the limit is reached. But it's still strange... |
Funny, on the stable release 'refresh' works, on the test release I keep getting the above errors. |
Reinstalled the docker alpha-2, now I get good results:
|
When I choose import on a bunch of files the volume isnt added to the library, in this case "Birthright".
|
The CV rate limit was reached so Kapowarr couldn't add anymore volumes. The handling of the rate limit is not ideal yet, but at least it's not crashing anymore |
Could the import save the state of the indexed volumes? When I choose to import only a few comics it has to re-index everything before I can select another few issues to import. I do this so I can check the folder structure, logs etc to see if all goes well. Now it takes me a minute of wait time between each try ;). |
Just now I tried to start fresh-- I import, it runs, last log is
But the indexer doesnt finish, screen stays blank and refresh icon keeps rotating. Somehow I feel the import needs to be iron clad, able to process batches of issues. Maybe even have the user select which folders to scan for import. Im sure most of us will be fine to import our library in batches of folders. Instead of the whole thing in one go :). Especially if we want to double check if the import has gone well (renaming). And we wouldnt push the comicvine api to its limits for each and every import run :P. EDIT: Just tried again, get the Comic Vine API rate limit and then the following. And the container is stopped.
|
If you wish I can give you access to my kapowarr web interface for testing import functionality. |
No need. The current situation is that it's working, it just needs even better rate limit handling and some caching. |
I released container You can select how many folders you want Kapowarr to "process" this run. So if you set it to 5, it will process 5 volume folders. If you import those and do it again, you'll get the next 5. You can also do it 1 by 1. It will only fetch for the selected files, so no wasted API calls. This removes the need for caching, because you simply just select the amount of folders you want to do in one go and if you actually import those then, you won't encounter them again so no need to cache their result. This is the window you get when the loading is done: If everything is imported, you'll get a simple screen saying so: So the UI is in general a lot nicer, waiting time is reduced when you want to import in batches and it takes a lot longer to reach the CV rate limit because of the reduced wasted requests. |
Library Import is now available in beta-4! Enjoy :) |
Is your feature request related to a problem? Please describe.
Currently Kapowarr doesn't allow importing existing volumes from root folder
Describe the solution you'd like
Kapowarr should be able to scan the root folder and add existing volumes
Additional context
If people want to migrate from other apps and have a fairly large library it makes it hard to move to Kapowarr
The text was updated successfully, but these errors were encountered: