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

Fix problems with redirects for datasheet links #233

Closed
wants to merge 5 commits into from

Conversation

T0jan
Copy link
Collaborator

@T0jan T0jan commented May 29, 2024

@eeintech the first idea on how to tackle #207 and #230. I kept it really basic for now as I only discovered problems with TI parts in the last months, if you prefer a more sophisticated solution let me know

@T0jan T0jan requested a review from eeintech May 29, 2024 15:35
@eeintech
Copy link
Contributor

Thanks @T0jan I'll have to review this a bit later 😄

run_tests.py Show resolved Hide resolved
@eeintech
Copy link
Contributor

@T0jan I won't have time to test but I have put a couple comments in your proposal. Also I need to figure out why the Mouser API is failing on main branch...

@eeintech
Copy link
Contributor

Hello @T0jan I just tested it and it works well for downloading and attaching datasheet to parts on InvenTree. However there is also a feature to download the datasheet in a local folder and this part hasn't been updated and it fails the download:

image

image

I think a more generalized approach and updating the download method in common > tools.py is better suited for post-processing URLs, what do you think?

@T0jan
Copy link
Collaborator Author

T0jan commented Jun 24, 2024

@eeintech you are right, completely forgot the local download in my try to keep the renaming and the redirect in one function, which is completely unnecessary. Moved the redirect part to the download function in tools.py

@eeintech
Copy link
Contributor

Hello @T0jan I allowed myself to tackle one layer further in #246
I still had issue with how datasheets were managed in the codebase, for instance having to download the same file twice.
So now I have added checks for server upload and local datasheet flags in order to not duplicate this operation.
Thanks a lot for the great work I will merge #246 directly into main 😃

@eeintech eeintech closed this Jun 28, 2024
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

Successfully merging this pull request may close these issues.

None yet

2 participants