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

Search function issues #47

Open
Chrisvann1 opened this issue Feb 26, 2024 · 1 comment
Open

Search function issues #47

Chrisvann1 opened this issue Feb 26, 2024 · 1 comment

Comments

@Chrisvann1
Copy link
Collaborator

Hello y'all,

I believe the search function is the last thing we need to fix for this project.

The search by filename is mostly working but the one issue is that we need an extra condition in the search_for_filename function that checks to see if the file is also in the notes folder. Because currently even if there are no files named "something.md" in the notes folder it will still say there are 2 results if this file exists in the lastmodified.csv file.

Additionally, I am running into some errors with the search by date function. Below is the error. I included my input on the first line above the error so y'all can make sure its not a mistake with how I formatted it.

Input the date you wish to search for and specify before or after (Format: 2000/01/01 before):

2024/10/21 after
Traceback (most recent call last):
File "/Users/chrisvann1/Desktop/Software Development/Project1/noteworthy/Frontend.py", line 285, in
Introduction()
File "/Users/chrisvann1/Desktop/Software Development/Project1/noteworthy/Frontend.py", line 282, in Introduction
main()
File "/Users/chrisvann1/Desktop/Software Development/Project1/noteworthy/Frontend.py", line 254, in main
SearchNotes()
File "/Users/chrisvann1/Desktop/Software Development/Project1/noteworthy/Frontend.py", line 119, in SearchNotes
searchOutput = backend.search_date(date, searchDirection)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/chrisvann1/Desktop/Software Development/Project1/noteworthy/backend.py", line 79, in search_date
this_epoch = string_to_epoch(this_date)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/chrisvann1/Desktop/Software Development/Project1/noteworthy/backend.py", line 12, in string_to_epoch
year_date_month = [int(date_number) for date_number in str(string).split('/')]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/chrisvann1/Desktop/Software Development/Project1/noteworthy/backend.py", line 12, in
year_date_month = [int(date_number) for date_number in str(string).split('/')]
^^^^^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: 'Date: 2024'

@tferrelCOW
Copy link
Collaborator

Currently not having this error. Tried the same input and everything

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

No branches or pull requests

2 participants