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

Replaces files during bulk-import #2866

Open
ToneLune opened this issue Jan 1, 2024 · 0 comments
Open

Replaces files during bulk-import #2866

ToneLune opened this issue Jan 1, 2024 · 0 comments

Comments

@ToneLune
Copy link

ToneLune commented Jan 1, 2024

Is your feature request related to a problem?

Good morning,

When I use the wonderful bulk-import tool with the following command:
sudo -u libretime libretime-api bulk_import --path /path/to/folder

When the file already exists in the database:
INFO found similar md5sum, ignoring

Describe the solution you'd like

Now, if the file is different, but its path is the same : the import tool will create a copy in its storage folder.

Is it possible for the file to be replaced with the new one rather than creating a copy?

Describe alternatives you've considered

To update a file on LibreTime, I must first delete it on the web interface before importing it again.

I would like to be able to update large quantities of files using import.

--delete-if-exists option delete source file if it exist in LibreTime storage.

Additional context

I have another problem, when I want to set the --library option
The script returns me an error:

Traceback (most recent call last):
  File "/usr/local/bin/libretime-api", line 8, in <module>
    sys.exit(main())
  File "/opt/libretime/lib/python3.9/site-packages/libretime_api/manage.py", line 20, in main
    execute_from_command_line(sys.argv)
  File "/opt/libretime/lib/python3.9/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line
    utility.execute()
  File "/opt/libretime/lib/python3.9/site-packages/django/core/management/__init__.py", line 436, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/opt/libretime/lib/python3.9/site-packages/django/core/management/base.py", line 412, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/opt/libretime/lib/python3.9/site-packages/django/core/management/base.py", line 458, in execute
    output = self.handle(*args, **options)
  File "/opt/libretime/lib/python3.9/site-packages/libretime_api/storage/management/commands/bulk_import.py", line 66, in handle
    importer.import_dir(Path(path).resolve(), library, allowed_extensions)
  File "/opt/libretime/lib/python3.9/site-packages/libretime_api/storage/management/commands/bulk_import.py", line 154, in import_dir
    raise ValueError(f"provided library {library} does not exist")
ValueError: provided library LIBRARY does not exist

I tried specifying the folder path, or the user name/number. How should I enter this option?

Thanks you, happy New Year ! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant