chapmanjacobd / library

80+ CLI tools to build, browse, and blend your media library: an index for your archive.
BSD 3-Clause "New" or "Revised" License
366 stars 10 forks source link

Error: 'Namespace' object has no attribute 'hash' #27

Closed deldesir closed 9 months ago

deldesir commented 9 months ago

Describe the bug When running the lb dl command, an AttributeError is encountered in the xklb/fs_extract.py module. The error message indicates that the 'Namespace' object has no attribute 'hash,' leading to the failure of the extraction process.

AttributeError: 'Namespace' object has no attribute 'hash'
> /home/dev/.local/pipx/venvs/xklb/lib/python3.11/site-packages/xklb/fs_extract.py(174)extract_metadata()
    172     }
    173 
--> 174     if mp_args.hash:
    175         # TODO: it would be better if this was saved to and checked against an external global file
    176         media["hash"] = sample_hash.sample_hash_file(path)

To Reproduce

  1. Execute the following command in the terminal:
    lb tubeadd test.db https://www.youtube.com/watch?v=sqoOzGMqCQU
    lb dl test.db --video https://www.youtube.com/watch?v=sqoOzGMqCQU -v
  2. Observe the AttributeError in the xklb/fs_extract.py module.

Expected behavior The lb dl command should execute successfully without encountering an AttributeError. The 'hash' attribute should be properly handled in the fs_extract.py module, ensuring a smooth extraction process.

Desktop (please complete the following information):

Additional context The error occurred within an ipdb (IPython Debugger) session.

chapmanjacobd commented 9 months ago

thanks for catching this!

v2.3.005 should work... I think I'll move away from using namespaces eventually; although the errors between function arguments, dictionaries, and objects are all pretty similar anyway.

I should probably add a test here but I don't really plan on making any changes to the extract_metadata function for a while