sim0n00ps / OF-DL

C# console app to download all of the media from Onlyfans accounts with DRM video downloading support
561 stars 54 forks source link

Print program version on start-up #439

Closed whimsical-c4lic0 closed 1 day ago

whimsical-c4lic0 commented 5 days ago

I've noticed in discord that users frequently confused about their program version. Also, users frequently post screenshots of their console output. By printing the program version on start-up, a lot of common back-and-forth in discord can be eliminated.

A downside of this functionality, though, is that you will need to manually update the version in OF DL/OF DL.csproj before each release. is that you'll need to use an additional build argument when building releases (e.g. -p Version=1.7.61). I personally think the trade-off is worth it, but I won't be the one updating the version each time :laughing:

In the future, a config option can be added to automatically check for updates. A github API request could be made to compare the current program version to the most recent release on github.

melithine commented 5 days ago

Would it be possible to pass the version in as an argument to dotnet build in some fashion, rather than having to have it checked in manually?

whimsical-c4lic0 commented 5 days ago

You're right. That's a better solution. I didn't think of that. I just pushed an update to remove the version from the .csproj file in favor of just using a build argument. (e.g. -p Version=1.7.61). I also updated the dockerfile and github actions to include the build argument.

sim0n00ps commented 4 days ago

Just a quick thing I want to clarify, I currently create the .exe for the release zip files in Visual Studio, with this change will I need to use the cmd instead with the new argument?

melithine commented 4 days ago

I believe you can specify it in VS as well, but I'm not exactly sure how... I've used VSCode a bunch, but not VS itself. There's some discussion about it here that may make more sense to you as a VS user: https://stackoverflow.com/questions/8446693/specify-assembly-version-number-as-a-command-line-argument-in-msbuild - specifically the part about using an assembly task seems like it would be what you're looking for, but that's a best guess.

Alternatively, we could look at automating the release builds with a GitHub Action, similar to how the GHCR Docker images are being created when a new tag is pushed. I've got some recent GHA experience from work, and with what's already being done for Docker, I don't think it would be difficult on this repo.

whimsical-c4lic0 commented 4 days ago

@melithine You beat me to the punch :laughing:

CLI or github actions would definitely be easier, but it should be possible within visual studio. I use Rider, so unfortunately I can't be of any help with visual studio settings though.

sim0n00ps commented 4 days ago

I was going to suggest Github actions as that will save me a bunch of time so I'll look into it tomorrow

melithine commented 4 days ago

LMK if you hit any snags.

sim0n00ps commented 4 days ago

LMK if you hit any snags.

I'm a complete noob when it comes to Github actions so if you think you could do it then go for it, if not then no worries

melithine commented 3 days ago

LMK if you hit any snags.

I'm a complete noob when it comes to Github actions so if you think you could do it then go for it, if not then no worries

I have this mostly working, but I'm not seeing where the generic auth.json and config.json are to include in the zip file. We might need to add a CHANGELOG.md file to track info about the release notes as well, but you can see things here: https://github.com/melithine/OF-DL/releases/tag/OFDLV9.99.111 with the GHA being here: https://github.com/melithine/OF-DL/blob/master/.github/workflows/publish-release.yml (the build log for that is here: https://github.com/melithine/OF-DL/actions/runs/9703192928)

whimsical-c4lic0 commented 3 days ago

LMK if you hit any snags.

I'm a complete noob when it comes to Github actions so if you think you could do it then go for it, if not then no worries

I have this mostly working, but I'm not seeing where the generic auth.json and config.json are to include in the zip file. We might need to add a CHANGELOG.md file to track info about the release notes as well, but you can see things here: https://github.com/melithine/OF-DL/releases/tag/OFDLV9.99.111 with the GHA being here: https://github.com/melithine/OF-DL/blob/master/.github/workflows/publish-release.yml (the build log for that is here: https://github.com/melithine/OF-DL/actions/runs/9703192928)

I'm surprised you're able to create an .exe from a ubuntu runner. I thought that you'd need to use a windows runner to create a windows executable.

melithine commented 3 days ago

Yeah, I saw that you can build for different runtimes using any of them with dotnet (including Darwin, but that wouldn't really be very supportable for us) and gave that a whirl.