SchraderR / sp-tarkov-client

This is a project to automate installing and updating SPT-Mods without searching every mod again and repeat the workflow every god damn time
GNU General Public License v3.0
17 stars 3 forks source link

Add update display by comparing date of last downloaded mods #105

Closed Markosz22 closed 2 months ago

Markosz22 commented 2 months ago

Adds a very basic update display system and a few extra information.

I'm not a web/angular developer so feel free to rewrite anything if you decide to accept it.

SchraderR commented 2 months ago

@Markosz22 Thanks for your contribution. I will look inside and give you feedback.

SchraderR commented 2 months ago

Sadly, I can't merge your changes into the main. There are some styling issues that could be fixed, but the main issue comes with the approach, how downloaded mods are checked. The part of fetching and getting the current version of mods would be okay to get merged (after some fixes) and if the mod update changes will be removed.

Example for the style issue: grafik

Check for Update:

I like your approach, but there are some issues: — Installed mods are not saved for a solo instance — Switching between instances, shows installed mods from another instance — Removed mods are not updated (maybe I missed the part) — Information should be fetched from the mods of your local installed instance and not of mods your processed

I have different ideas, how the update process should work.

Solution 1

  1. “Fetch Download Information”-Step will save all relevant information for the update process a. save the URL of the mod (hub-url) (so we can directly (without redirect) get hub information) b. save the hub-fileId (important because with this ID and HTTP request we can fetch information (like an overview of versions))
  2. Install / Unzips a. will get the hub-fileId from the first step, unzips all files and will look in the package.json or DLL files and get the version of the current processed files b. will be all saved in the user setting as a new array of information
  3. Update will use the information, check for updates and notify the user if there is a new version

Solution 2

  1. “Fetch Download Information”-Step will save all relevant information for the update process a. save the URL of the mod (hub-url) (so we can directly (without redirect) get hub information) b. save the hub-fileId (important because with this ID and HTTP request we can fetch information (like an overview of versions))
  2. Normal Process of initial steps will fetch all local mod information a. app.component -> electron and fetch informations
  3. Mod Mapping will be shared between angular and electron
  4. fetched information will be checked with the informations from the "fetch download information" step a. will compare names b. if the names are equal -> Happy; if not manual mapping or no happy path
  5. Update will use the information, check for updates and notify the user if there is a new version

Both ways have different issues. Solution 1 difficult is to create a logic to extract the logic of the current installed mod (or its getting a subset before and after the installation and use the difference) Solution 2 got some issues because there are so many mods and names on the hub and in the package.json and dlls are not always equal or even close

Markosz22 commented 2 months ago

Thank you for the feedback. I did not keep the instances in mind and skipped the remove part as there was no mod uninstall. My last commit did not fix any of the issues you mentioned, just added update feature on the download page with the same implementation. image

I will abandon this PR and create a new branch without the update related changes for the last updated date and version display tomorrow. Other than the style issue, is there anything I should keep in mind?

SchraderR commented 2 months ago

@Markosz22 Thanks. I think you should check out the new branch named milestone/v0.2.11.

I saw some messages in the discord and found out, some ppl. installed older version of mods because there was no version of the mod linked in the search windows.

OLD: grafik

NEW: grafik (I added a call and it's fetching the version number)

Because the data was now available, it was just a copy and paste to add it to the download list grafik

So I kinda programmed your part. Sorry :) But feel free to create and check out the changes with the last change / date information. It was a nice addition to the mod card.

For fetching the time, you could check, if you directly scrap the date / time information from the hub or make a custom solution like in this pr. Its up to you.