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

[NetworkAPI] Overhaul entrypoints #24

Open
3 of 8 tasks
SrRapero720 opened this issue Oct 1, 2023 · 1 comment
Open
3 of 8 tasks

[NetworkAPI] Overhaul entrypoints #24

SrRapero720 opened this issue Oct 1, 2023 · 1 comment
Labels
Type: Enhancement New feature or request
Milestone

Comments

@SrRapero720
Copy link
Member

SrRapero720 commented Oct 1, 2023

OVERVIEW

Current UrlAPI and NetworkAPI sucks.
The most important change is have an URL-like class containing the whole set of variables (source string, URL, attached fixers and url type). Catching the URLs is neccesary to avoid had to re-fix the URL (in case urls needs to be "Refixed" everytime can be done just "reloading it".

Network request should be done using java 8 openConnection in a wrapper class just to have better control of the InputStream and the gson coversion

This also will add support for some custom protocols for local files (Addressing all kind of special support on modders/devs side)

PROTOCOLS
here is the list of the added protocols to let users have access to their local files

  • local:///<path/to/file.mp4> - the current RUNTIME path file
  • game:///<path/to/file.mp4> - the game path file (result might be same as local)
  • users;//<pc_user>/<path/to/file.mp4> - specific user path
  • user:///<path/to/file.mp4> - current user path
  • tmp:///<path/to/file.mp4> - temp file path.

Task to acomplish this

  • Remove third-party dependencies (only rely on gson)
  • NetFetch (wrapper of URLConnection) and NetUrl
    • NetURL: data about Url Type (local, stream, fixed, fixed date)
    • NetURL: catching
  • Mark NetworkAPI as a Unsafe API: it will throw exceptions if fails
  • Make models of every fixer page (json to java object)
  • module fixers
  • Add mature entrypoint (different over "Special fixer")
@SrRapero720 SrRapero720 converted this from a draft issue Oct 1, 2023
@SrRapero720 SrRapero720 added this to the WATERMeDIA 2.1.0 milestone Nov 2, 2023
@SrRapero720 SrRapero720 added the Type: Enhancement New feature or request label Jan 2, 2024
@SrRapero720 SrRapero720 moved this from Todo to In Progress in WATERMeDIA 3.0 - rewrite Mar 21, 2024
@SrRapero720 SrRapero720 changed the title [UrlAPI] Overhaul entrypoints [NetworkAPI] Overhaul entrypoints Apr 26, 2024
@SrRapero720
Copy link
Member Author

Updated protocols

  • water://local.wm/<path/to/file.mp4> - the current RUNTIME path file as root
  • water;//user.wm/<video/path/to/file.mp4> - Active user video path as root
  • water://tmp.wm/<path/to/file.mp4> - TMP path as root.

Discarted

  • users;//<pc_user>/<path/to/file.mp4>: No reason to exists
  • game:///<path/to/file.mp4>: duplicate of local

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant