Skip to content

library.add_files() only adding .docx file to the library and ignoring .pdf files #49

Answered by turnham
jcalebsmith asked this question in Q&A
Discussion options

You must be logged in to vote

Ahh, i think I see the problem. In the code above, add_files(...) is only actually called in the case where the library doesn't exist. Once the library has been created then running that code again won't call add_files(...) again. So can you try moving that line out of the else, like this:

...
    # Load the library or create and populate it if doesn't exist
    if Library().check_if_library_exists(library_name):
        # Load the library
        library = Library().load_library(library_name)
    else:
        print (f' > Creating library {library_name}...')
        # Create the library
        library = Library().create_new_library(library_name) 
    # Add files to library
    library.a…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@jcalebsmith
Comment options

Answer selected by jcalebsmith
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants