Drifty icon indicating copy to clipboard operation
Drifty copied to clipboard

[FEATURE] Internal change for the handling of external data

Open EasyG0ing1 opened this issue 1 year ago • 17 comments

Is your feature request related to a problem? Please describe.

No response

Describe the solution you'd like.

This is not so much a feature request as it is an idea for internally restructuring Drifty so that it no longer relies on text files for things like URL lists, download queues, or even settings (where leveraging the Java Preferences class has limitations).

Instead, I am proposing that Drifty might be a good candidate to leverage a SQLite database for the storage and retrieval of dynamic data. The database / SQL method of storing and retrieving information is well understood and is relatively easy to implement.

A core class called something like DB could be created which contains all of the methods required to interact with external data. The database could have various tables, for example, a Jobs table which contains all of the relevant data for a download job in each record, or even a Log table which can store the various logs that Drifty generates. A Settings table could be used to store things like download folders, video quality preferences, or settings for GUI themes in the future. We could even keep a table for download statistics that keeps track of download metrics such as transfer speeds for past downloads etc. which then provides metrics that might be interesting in different contexts.

This change to Drifty could be developed non-invasively at first where it would just be a class that maintains the database file where the methods are defined then once they are in place and tested and working, it would then be a matter of converting those places throughout the program where it keeps information in flat files, and convert those methods to use the DB methods.

The database methods could even be presented to other developers as sort of an interface to external data where future development might be streamlined by the presence of the DB class, but this will be highly dependent on the nature of any future development.

Screenshots

No response

Additional information

This would also remove the GSON dependency because the use of Json files would be removed from the program all together.

EasyG0ing1 avatar Jan 10 '24 06:01 EasyG0ing1

Hello 👋! Thank you very much for raising an issue 🙌! The maintainers will get back to you soon for discussion over the issue! 🚀

Meanwhile you can also discuss about the project in our Discord Server 😀

github-actions[bot] avatar Jan 10 '24 06:01 github-actions[bot]

Thank you for raising the issue @EasyG0ing1! It's a great improvement that can be implemented. Would you like to work on this issue?

SaptarshiSarkar12 avatar Jan 10 '24 08:01 SaptarshiSarkar12

I am going to work on this issue. Self-assigning myself :smiley:

SaptarshiSarkar12 avatar Mar 04 '24 13:03 SaptarshiSarkar12

Hello @SaptarshiSarkar12. Are you still working on this or can i try it?

Viereckig avatar Apr 11 '24 14:04 Viereckig

@Viereckig Thank you for your interest :smile:. Sorry, due to lack of time, I could not focus on this issue. Hence, you can work on this issue. If you face any problem, you can post it here and we can discuss on this issue in our Discord Server :smiley:.

SaptarshiSarkar12 avatar Apr 11 '24 14:04 SaptarshiSarkar12

which Java SDK do i need to use?

Viereckig avatar Apr 11 '24 15:04 Viereckig

@Viereckig The latest LTS Release - JDK 21.

SaptarshiSarkar12 avatar Apr 11 '24 15:04 SaptarshiSarkar12

Hey @SaptarshiSarkar12 have you ever encountered a problem when trying to run the program via Docker, as described in the README, where it fails to fetch packages? image image

What i already tryed:

  • PC restart
  • Docker Desktop reinstallation
  • Windows Firewall deaktivated
  • checked Internet connection

Viereckig avatar Apr 11 '24 17:04 Viereckig

@Viereckig No, I haven't encountered such problems before. But, you can try running sudo docker compose run cli command again after deleting the cached images using sudo docker system prune. Please let me know if it works for you :smile:.

I tried today morning (IST timezone) and it works for me :point_down: image

SaptarshiSarkar12 avatar Apr 12 '24 04:04 SaptarshiSarkar12

@Viereckig If that does not work for you, you can try changing your DNS to 1.1.1.1 which is a free public domain offered by Cloudflare. You can change your DNS by following this tutorial - https://one.one.one.one/dns/#setup-instructions.

SaptarshiSarkar12 avatar Apr 12 '24 04:04 SaptarshiSarkar12

@Viereckig If that does not work for you, you can try changing your DNS to 1.1.1.1 which is a free public domain offered by Cloudflare. You can change your DNS by following this tutorial - https://one.one.one.one/dns/#setup-instructions.

already did that...

Viereckig avatar Apr 12 '24 06:04 Viereckig

@Viereckig No, I haven't encountered such problems before. But, you can try running sudo docker compose run cli command again after deleting the cached images using sudo docker system prune. Please let me know if it works for you 😄.

I tried today morning (IST timezone) and it works for me 👇 image

yeah i try that thanks

Viereckig avatar Apr 12 '24 06:04 Viereckig

@Viereckig No, I haven't encountered such problems before. But, you can try running sudo docker compose run cli command again after deleting the cached images using sudo docker system prune. Please let me know if it works for you 😄. I tried today morning (IST timezone) and it works for me 👇 image

yeah i try that thanks

@Viereckig Did that work?

SaptarshiSarkar12 avatar Apr 12 '24 11:04 SaptarshiSarkar12

docker system prune

@SaptarshiSarkar12 sorry for the late response, I was very bussy the last few days! yeah it works now thanks

Viereckig avatar Apr 14 '24 19:04 Viereckig

docker system prune

@SaptarshiSarkar12 sorry for the late response, I was very bussy the last few days! yeah it works now thanks

@Viereckig It's fine 🙂. That's a good command to clear everything (caches, images, containers, etc.) from docker and helps in most cases of unexpected errors.

SaptarshiSarkar12 avatar Apr 15 '24 03:04 SaptarshiSarkar12

@Viereckig Are you facing any issues? Have you started working on this? Please let me know :smile:.

SaptarshiSarkar12 avatar May 07 '24 05:05 SaptarshiSarkar12

@Viereckig has informed me that he is no longer going to work on this issue. This issue is now open for contribution.

SaptarshiSarkar12 avatar Jun 13 '24 16:06 SaptarshiSarkar12