Skip to content
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

[Bug Report] Lost Tags after library root directory change #146

Closed
VegethB opened this issue Jan 13, 2021 · 8 comments · Fixed by #156
Closed

[Bug Report] Lost Tags after library root directory change #146

VegethB opened this issue Jan 13, 2021 · 8 comments · Fixed by #156
Labels
bug Something isn't working

Comments

@VegethB
Copy link

VegethB commented Jan 13, 2021

Describe the bug

After moving the library from the old disk to a new one (larger), the tags I added (luckily I stopped at the first 8 9 series) have been deleted. Let's say that with the fact that the tags have to be transcribed every time (because mango does not remember them / does not suggest them to you) I imagine the saints who come down if with 70 series they all go to be blessed 😂.

To Reproduce
Steps to reproduce the behavior:

  1. Stop mango.
  2. Copy / Cut the library folder to a new place.
  3. Edit root library path in the config.
  4. Start Mango.

Expected behavior
Keep Tags

Environment (please complete the following information):

  • OS: WS2019 with WSL (Ubuntu 20.04)
  • Mango Version 1.8.3

Additional context

I assume it's a bug.
If not then there are 2 feature requests:

  1. Even moving the library root directory will not be deleted;
  2. After having written them once, mango will remember and allow you to select them from a list (avoiding having to rewrite the same tag every time).
IMGs:

image

Komga Example of Tags list:

image

(yup, Komga handles "H" series 😎)

@VegethB VegethB added the bug Something isn't working label Jan 13, 2021
@hkalexling
Copy link
Member

This is expected. I have a feeling that I will have to explain this to users many times so I put it in the wiki.

The tag suggestion though is a great idea, and I will work on it soon 👍

@hkalexling
Copy link
Member

I know the current state is not ideal, but I can't think of a better solution. Any suggestions are welcome!

@VegethB
Copy link
Author

VegethB commented Jan 13, 2021

This is expected. I have a feeling that I will have to explain this to users many times so I put it in the wiki.

The tag suggestion though is a great idea, and I will work on it soon 👍

Wait ... a Wiki? ok ...
But if they are saved on the DB, all the more reason why are they lost?
After all, the series (covers) are not deleted even if I change the root directory.
Let's take example from the plex DB.
The root directory (which can be "C:\myTVShow") is stored in its own directory table. While all routes are saved elsewhere.

Former.
Series1 | C:\myTVShow\Show1\Season1\ [bad, because if I change "C:\myTVShow" this entry becomes unusable];

Series1 | Show1\Season1\ [good, because regardless of what I do with "C:\myTVShow" all data associated with "Show1\Season1\" remains there. It will then be Plex's trick to join the associated folder for "Show1\Season1" with "C:\myTVShow" in "C:\myTVShow\Show1\Season1\". I hope I have explained.

DB ex:

Plex DB (Directory):
image

Plex DB (Library):
image

Plex DB (Metadata items):
image

Plex DB (Roots Folders):
image

Library for example can be: My Mango Library1
Library root folder can be: C:\myMangoLibs1
Directory of the items on the Root folder, can be: Accel World\Volume1; MyManga2; etc.
Metadata items is where (name, date, and any other metadata is saved for any directory entry).

The best solution is to create a Plex DB and learn how it work (or Komga for manga specific and tags)

Any way thanks for the instant reply and support 👍🔝

@VegethB VegethB closed this as completed Jan 13, 2021
@hkalexling
Copy link
Member

hkalexling commented Jan 13, 2021

After all, the series (covers) are not deleted even if I change the root directory.

Thumbnails and covers are different things. A cover is the first page of an entry, and a thumbnail is a low-resolution version of the cover. After moving your library, the thumbnails are deleted, but the covers will never be deleted because they are in the cbz/cbr files.

The best solution is to create a Plex DB and learn how it work (or Komga for manga specific and tags)

As far as I know, Komga also has this issue? (see gotson/komga#217). What you described is to essentially store the relative paths instead of the absolute paths. This could work in your case, but it would still break when you rename a folder/file.

@VegethB
Copy link
Author

VegethB commented Jan 13, 2021

Thumbnails and covers are different things. A cover is the first page of an entry, and a thumbnail is a low-resolution version of the cover. After moving your library, the thumbnails are deleted, but the covers will never be deleted because they are in the cbz/cbr files.

No, I'm talking about the cover that you can manually change and that is saved in uploads.
Even after moving everything, those covers remained.

This could work in your case, but it would still break when you rename a folder/file.

Nope (for plex logic / db).
I finished moving 2tb of Anime from one HDD to another. (E:\ to H:).
All metadata remained and the series were not deleted.
Also (I don't know how though) if I change the name of a file on plex (ex. "Dragon Ball - s01e02 - ajajla.mp4" with "Dragon Ball - s01e02 - Bulma and Goku.mp4" the associated metadata are not deleted. will update the ep2 entry with the new "path".
Unfortunately I don't know how he does it. But this is the official guide on how to move files without losing associated metadata: https://support.plex.tv/articles/201154537-move-media-content-to-a-new-location/

Obviously these are just conjectures.
I think plex works by creating "id" for everything and then they are associated:
Root folder1 ID 1;
Root folder2 ID 2;
Library1 ID1;
Library2 ID2;
Accel World\Volume 1\File1 ID 1;
Accel World\Volume 1 \File2 ID 2;
Metadata1 ID1 (this meta will then be associated with ID 1 of "file1" and if "file1" becomes "gile1" through a scan process it will update the Entry "Accel World \ Volume1 \ File1" with the new path found by the scanner). This is why I said that the best solution was to install plex and analyze the changes that the DB undergoes when you move etc.

As for Komga, I was referring to the simple fact of seeing how Komga saves tags and manages them (if I'm not mistaken it's opensource). Then if even Komga deletes them if you change root folder is another story (but at least you can see how according to the creator of Komga the list of tags is managed).

I know the current state is not ideal, but I can't think of a better solution. Any suggestions are welcome!

Maybe you can simply add to the mango DB a new table with the Tags saved inside and when I press + Tags from the UI, he will recall that table of Tags (which is enriched as I add new ones to the series) so that clicking on the tag name, he is automatically added to the series.
I repeat, these are just conjectures, unfortunately I have no experience in programming because otherwise you would now have 100 pool requests 😂😁 @hkalexling

@hkalexling
Copy link
Member

In v0.19.0, Mango would provide suggestions when you are adding tags. Thanks for the feature request!

@VegethB
Copy link
Author

VegethB commented Jan 17, 2021

@hkalexling
Rereading, I realized that I have explained myself badly.
From what it looks like, plex creates a virtual "name" for the file paths (id I was talking about). In theory it means that:

  1. if the ID of the root_path (C: \ Anime1) and the ID of the folder containing the season 1 (\ Season 01) + ID for the mp4 file 1 (they are random and not the real names) I can change the name of file 1 which at that point will not be deleted from the DB but marked as absent episode (just like on plex). At that point it will be the scanning process that will detect the new name of the .mp4 associated with the ID of the elusive episode 1.

Ex:

RootP1 ID: 7 (C:\Anime1);
Serie1 ID1: 100 (\Accel World);
Serie1 S1 ID1: 201 (\Season 01);
Episode ID 1: 9798 (Accel World - s01e01 - Accelerated World.mp4);

7/100/201/9798 = "C:\Anime1" + "\Accel World" + "\Season 01" + "Accel World - s01e01 - Accelerated world.mp4"
If I remove "accelerated world" from the name, the database that no longer finds the file will add a "flag" indicating the file absent status.
The scanner will then find the new file path and will be updated in entry 9798 (which corresponds to ep1).
I hope I have clarified better.
Technically it means that if I change the root path from 7 to 8 the metadata associated with ID 9798 are not affected (because they are the metadata to load for ID 9798 regardless of whether the physical files on the disk are in the path saved on the DB).
In a nutshell I think we need to create a separate system that is able to update the path of the .zip / .cbz / etc. of the chapter / volume of the series.

  1. DB with virtual names / IDs that simulate the folder + file structure
  2. Process that verifies if there have been changes to the file system where the files reside and if so quick scan with updating of the changes to the file system in the DB.

Unfortunately technically I can't add anything else. Of course I could have written a lot of crap 🥴, consider yourself if that's a possibility 👍.

@hkalexling hkalexling mentioned this issue Jan 29, 2021
@hkalexling
Copy link
Member

In v0.20.0 we introduced signature matching, which allows you to safely move/rename files and folders in your library. Thanks for the report and suggestions!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants