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

✨ [REQUEST] Jellyfish NAS: omit /config/addons_config/jellyfin/data/metadata from backup #1048

Open
2 tasks done
bilogic opened this issue Oct 25, 2023 · 39 comments
Open
2 tasks done
Labels
enhancement New feature or request prevent stale Prevents stale being applied

Comments

@bilogic
Copy link
Contributor

bilogic commented Oct 25, 2023

Checked

  • If a new addon, I have checked on Google that such as addon doesn't already exists
  • If a new feature, I have searched in the discussions & issues that it was not already covered

Which addon?

Jellyfish NAS

Is your feature request related to a problem? Please describe

Yes, the /config/addons_config/jellyfin/data/metadata folder is over 2GB and that bulks up my backup which was originally less than 500MB

Describe the solution you'd like

I like to have the backup as small as possible

@bilogic bilogic added enhancement New feature or request prevent stale Prevents stale being applied labels Oct 25, 2023
@txitxo0
Copy link

txitxo0 commented Nov 1, 2023

Checked

  • If a new addon, I have checked on Google that such as addon doesn't already exists
  • If a new feature, I have searched in the discussions & issues that it was not already covered

Which addon?

Jellyfish NAS

Is your feature request related to a problem? Please describe

Yes, the /config/addons_config/jellyfin/data/metadata folder is over 2GB and that bulks up my backup which was originally less than 500MB

Describe the solution you'd like

I like to have the backup as small as possible

Why don't you just avoid the jellyfin addon from the backup? Do you need to keep safe all this metadata?

@bilogic bilogic closed this as completed Nov 1, 2023
@bilogic
Copy link
Contributor Author

bilogic commented Nov 1, 2023

I like to backup the jellyfin configuration, but definitely not this metadata. Ideally, it would be great if I could just exclude /config/addons_config/jellyfin/data/metadata from the backup. But the backup addon that I'm using doesn't allow for that. thomasmauerer/hassio-addons#125

@bilogic bilogic reopened this Nov 1, 2023
@alexbelgium
Copy link
Owner

As is said in the thread you’ve linked :

No, unfortunately that's not possible.

This addon uses (as most other backup addons) the functionality of the supervisor to create the backups. And the supervisor only allows to exclude the five folders: "config", "ssl", "share", "addons/local" and "media".

alas it is still the same ; the true solution would be to be to request to the HA team to implement something such as a .exclude feature.

because if I store the metadata in /data, it will still take place in backups, and if I store it in a non rémanent folder people will be unhappy as it would rebuild metadata at each start…

@bilogic
Copy link
Contributor Author

bilogic commented Nov 2, 2023

.exclude sounds like a great idea!

@alexbelgium
Copy link
Owner

Yes but I can’t implement that it must be done in the ha supervisor

@alexbelgium
Copy link
Owner

Ok I have a solution, I'll check

alexbelgium added a commit that referenced this issue Nov 3, 2023
alexbelgium added a commit that referenced this issue Nov 3, 2023
@alexbelgium
Copy link
Owner

Hi, I've pushed a test version could you please check ?

I've moved those folders to /data, which allows to take advantage from the embedded feature from HA to exclude folders stored in /data

@alexbelgium
Copy link
Owner

Typo, I'll push a test2

@txitxo0
Copy link

txitxo0 commented Nov 3, 2023

Oh! Good catch! Great idea!

@bilogic
Copy link
Contributor Author

bilogic commented Nov 3, 2023

What do I need to do? I moved metadata to /data/metadata, or should it be /data/data/metadata?

@bilogic
Copy link
Contributor Author

bilogic commented Nov 3, 2023

image

I manually did this, correct?
Testing the backup now.

@alexbelgium
Copy link
Owner

Oh, everything should have been done automatically ! And your current metadata folder should have moved to /data/data/metadata (not pretty but easiest for me to keep the existing structure)

@bilogic
Copy link
Contributor Author

bilogic commented Nov 3, 2023

How about the backup? Should I be excluding certain folders etc?
Actually I did try creating a symlink yesteday. The backup follow the links and was still as big, it did not shrink.

@bilogic
Copy link
Contributor Author

bilogic commented Nov 3, 2023

Nope, I'm still getting 1.5GB backup

@bilogic
Copy link
Contributor Author

bilogic commented Nov 3, 2023

Wait, correction. It works! Something else got bloated, let me fix on my end. Thank you!

@bilogic
Copy link
Contributor Author

bilogic commented Nov 3, 2023

image

After moving metadata to /data/metadata, it got backed up to vscode instead. Any idea?

@alexbelgium
Copy link
Owner

Well this would be most unlikely… one add on cannot communicate with others data folders. I would recommend that you put back this folder in the initial jellyfin/data/metadata, then restart the jellyfin addon and check that the folder disappears. Thanks !

@bilogic
Copy link
Contributor Author

bilogic commented Nov 3, 2023

image

Ok, I stopped JF and did what you said and got the above using VSCode's terminal

After JF restarted, transcodes became a symlink, but metadata stayed as-is

@alexbelgium
Copy link
Owner

Hi, ingress is not working with jellyfin in the latest version. Was it previously ? Thanks

@bilogic
Copy link
Contributor Author

bilogic commented Nov 5, 2023

what do you mean by ingress?

@alexbelgium
Copy link
Owner

Accessing jellyfin from the sidebar in HA, instead of using ip:port

@bilogic
Copy link
Contributor Author

bilogic commented Nov 5, 2023

If you use HTTP, ingress works, but if configured for HTTPS, ingress stops working.
I switch to using caddy to provide HTTPS when accessing jellyfin directly, so it works both HTTP and HTTPS now.

@alexbelgium
Copy link
Owner

Thanks

@txitxo0
Copy link

txitxo0 commented Nov 5, 2023

I am thinking maybe it is good to use the same strategy in the emby addon! :)

@bilogic
Copy link
Contributor Author

bilogic commented Nov 6, 2023

Using caddy also cuts down on the need to to deal with the quirks of each addon individually, e.g. Navidrome needs the cert in PFX format... 🤦‍♂

@nordeep
Copy link

nordeep commented Nov 12, 2023

Seems last changes with folders fully broken metadata in my case. Additionally, excluding metadata doesn't seem like a good solution. Sometimes this metadata is unique, such as custom pictures.

@alexbelgium
Copy link
Owner

Then I'll put back things how they were and think about it again ;-)

alexbelgium added a commit that referenced this issue Nov 12, 2023
@alexbelgium
Copy link
Owner

A way to test without modying addon is to use my custom script mod : https://github.com/alexbelgium/hassio-addons/wiki/Add%E2%80%90ons-feature-:-customisation

To do that, just create the file : /config/addons_autoscript/jellyfin.sh and put inside something like (not tested) :

#!/bin/bash
echo "Starting script"
# Create folder if not existing
mkdir -p /data/metadata
# Add permissions to LSIO default user
chown abc:abc /data/metadata
chmod 755 /data/metadata
# Remove folder if existing
if [ -d /config/addons_config/jellyfin/metadata ]; then rm -r /config/addons_config/jellyfin/metadata; fi
ln -s /data/metadata /config/addons_config/jellyfin
echo "Done"

@bilogic
Copy link
Contributor Author

bilogic commented Nov 13, 2023

@nordeep

  1. I thought that metadata is automatically created by JF and acts like a cache?
  2. How are you adding custom data to it?
  3. From what I observe, JF adds some images etc right beside my media folders, *-backdrop.jpg, *-posters.jpg, *-logo.jpg
  4. Perhaps you can provide more details? Otherwise I really don't think it is helpful to bloat HA's backup

@nordeep
Copy link

nordeep commented Nov 13, 2023

@bilogic

  1. I'm not expert in JF. As I know metadata is updating by request from web-interface. In my case all metadata was gone as a result - no images at all in JF. I checked the folders and saw the reorganization, but the metadata folder was empty. As I understand, the script did not work correctly. Good thing I had a backup. I tried to move restored metadata to the new folder, but without success, the images did not appear in JF.
  2. Adding posters via the web interface. Not all posters are available through JF fetch. Some posters I have upload manually.
  3. As I know, images are stored in the metadata folder.
  4. It's not exactly convenient to restore JF from a backup and lose all the images.

@alexbelgium
Copy link
Owner

Indeed... I've put the code as it was, and then propose to deal with avoiding the backup with my specific script above

Btw, HomeAssistant has once again change the logic of addons and the /config won't be available anymore so it will likely break lots of things...

@bilogic
Copy link
Contributor Author

bilogic commented Nov 13, 2023

@alexbelgium what's changed? any links? Thanks.

@alexbelgium
Copy link
Owner

Sorry it was this push fbc68bd normally the latest version should restore the old metadata behavior

@nordeep
Copy link

nordeep commented Nov 13, 2023

@alexbelgium I didn't update to the latest version jet. Just downgrade to .11 version and restore metadata from backup. Personally, it was not a problem for me. Thank you for your hard work and the time you spend!

@bilogic
Copy link
Contributor Author

bilogic commented Nov 13, 2023

@alexbelgium May I suggest having a JF lite? The difference is only in the config file, correct? If it is too much trouble, don't worry. I will create my own fork. Thank you.

@alexbelgium
Copy link
Owner

@alexbelgium May I suggest having a JF lite? The difference is only in the config file, correct? If it is too much trouble, don't worry. I will create my own fork. Thank you.

You mean just for this metadata thing? The easiest would be to apply what I described in this post : #1048 (comment) it is the best way to customize an existing addon apart from forking it

@bilogic
Copy link
Contributor Author

bilogic commented Nov 13, 2023

@alexbelgium

Pardon me, too many things happening on my side to pay close attention.

  1. May I ask, will your eventual JF backup or don't backup metadata?
  2. If it backs up metadata, what are my options to not back it up? Create the script from #1048 (comment) to skip it?

@alexbelgium
Copy link
Owner

Hi, summary is :

  • The current code reverts behavior and backups metadata, as previously
  • If you want to avoid backing it up, the best way is to used my proposed wow (not tested) to skip it
  • HA has introduced some breaking change where addons don't have access anymore to /config, so it will break things but I'm not sure when it will start happening (not related to this specific thread but general comment)

@encryptix
Copy link

encryptix commented Jan 22, 2024

Hi, I've pushed a test version could you please check ?

I've moved those folders to /data, which allows to take advantage from the embedded feature from HA to exclude folders stored in /data

I've followed the instructions above to move the metadata (and cache /config/addons_config/jellyfin/cache) which took it out of the core backup. The data is now included as part of the jellyfin addon, which made it easy to exclude from backups.

Is that how the workaround above is meant to work? Just want to be sure i've it set up correctly and that theres no way of backing up jellyfin too (but not the data).

which allows to take advantage from the embedded feature from HA to exclude folders stored in /data
I wasnt too sure what this meant.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request prevent stale Prevents stale being applied
Projects
None yet
Development

No branches or pull requests

5 participants