hotsapi / Hotsapi.Uploader

Uploads Heroes of the Storm replays to hotsapi.net
MIT License
26 stars 10 forks source link

Mac client #5

Open poma opened 7 years ago

poma commented 7 years ago

Looks like many users are requesting it so this is high priority.

I think it should be a pretty easy task. Main logic is contained in Hotsapi.Uploader.Common and Heroes.ReplayParser which should be converted to .NetStandard projects, they have almost no dependencies so it's unlikely this introduces any errors. Mac client then can be targeting .NET Core, and some UI framework that provides native look in OS (xwt/Eto.Forms or Xamarin.Forms).

UI project is designed to be minimal and handle only OS-specific tasks. Here's responsibilities of windows project:

idooo commented 7 years ago

Hi, my C# is bad so I can't help here but I quickly wrote my own uploader using Node.js + Electron https://github.com/idooo/hotsapi-electron-uploader

I don't know how relevant is that thing =) but at least for now it can be used by mac users

poma commented 7 years ago

Nice, I'll mention it in my next update post. There also a pending pull request to a cross-platform hotslogs uploader eivindveg/HotSUploader#162 to support hotsapi.

GregAlexJames commented 7 years ago

Quick question, do you have any preferences for UI technologies. Options looks as per follows:

Xamarin.Mac Pros: Native UI for Mac Cons: Have to learn another UI paradigm (different to XAML, uses storyboards etc) Not Cross Platform

Xamarin.Forms Pros: Cross Platform (but not with WPF) Similar UI paradigm to XAML Cons: Still in Beta Higher risk of issues / Small UI nuances

xwt/Eto.Forms Pros: Cross Platform (including WPF) Cons: Different UI paradigm to XAML Higher risk of issues / small UI nuances

Looking at the existing code the UI portion is very small. Given that you already have a WPF version, I do not see the point of having a cross platform UI. My gut feel is to use Xamarin.Mac for the UI, but the others should be easy enough. Which one that should be used is up to you though, as the biggest thing is that it needs to be something that you can maintain going forward (hence Xamarin.Forms may be better for you as it more closely follows XAML paradigm / databinding etc that it looks like you are experienced with).

Last note, I have experience with Xamarin.Mac, and Xamarin.Forms for iOS / Android. I have no experience with Eto.Forms so do not truely know how good or bad it works.

koliva8245 commented 7 years ago

There's also AvaloniaUI which is a cross platform XAML (like WPF). However it is in alpha.

poma commented 7 years ago

I only have a requirement that UI for mac should have native look.

I don't mind learning any new frameworks, our UI is pretty simple so I think I will be able to maintain any framework. I don't have experience with any of them so it's your choice. Probably Xamarin.Mac is the way to go.

poma commented 7 years ago

18 is done

Sonix commented 7 years ago

I looked into it this evening and got most things set up. It looks like NLog, which is used in Common, isn't compatible with Xamarin.Mac though. I have to say that I'm more experienced in writing native Mac/iOS-Apps and not very familiar with Mono/Xamarin/Xamarin.Mac so maybe this isn't an issue and i just couldn't figure out which thing I have to press (Visual Studio for Mac is pretty awful). I'll continue tomorrow, but maybe someone has a hint for me?

Is Nlog as a logging framework set in stone or could we maybe migrate to another one if thats really the problem?

poma commented 7 years ago

We can migrate to log4net. It's almost the same except configs are less intuitive and I didn't work with it before. Brief googling says that it is supported on Xamarin.Mac (need to check though)

But first let's try to google what's up with NLog, it's a major framework I thought it should support most platforms.

Sonix commented 7 years ago

It does support most platforms, but Xamarin.Mac ist curiously missing in the Support section here: http://nlog-project.org/

This StackOverflow-Questions suggests to just use log4net: https://stackoverflow.com/questions/28282850/is-there-any-way-to-use-nlog-or-log4net-in-a-xamarin-mac-project

Maybe this here is an approach that could work? I'm not sure since I don't know enough about that stuff: https://martynnw.wordpress.com/2016/10/16/logging-with-nlog-in-xamarin-forms/

Anyway, will try to work around logging for now (maybe by disabling it for the time being) and try to get a bare bones app to work.

poma commented 7 years ago

I found a good way to work around logging compatibility - use Microsoft.Extensions.Logging

ghost commented 7 years ago

I'm taking a crack at this. I'll post updates on Wednesdays.

poma commented 7 years ago

So far 2 people tried to port this on Mac and then disappeared. Is there some common reason for this?

dcasadevall commented 6 years ago

I am not sure about the reason, but I would be interested in helping. I can develop in native or Xamarin. No real preference. (Though I personally would prefer avoiding locking a project to a third party framework).

MGatner commented 6 years ago

I've been working with Heroes Share on a native (Swift) macOS app for multi-provider uploads. This would likely be proprietary but I want to make sure the community edition doesn't die. I checked with eivindveg on plans for multi-provider support (https://github.com/eivindveg/HotSUploader/pull/162), but also curious if anything came from @dcasadevall ?

rjnienaber commented 4 years ago

Is this still a high priority? It seems like there are other mac alternatives (e.g. Stats of the Storm, though it doesn't monitor the replay folder). Perhaps we should redirect users there?

poma commented 4 years ago

Well there are not that many tasks for uploader in general, so compared to other uploader tasks this one is fairly important. The core part that parses and upload replays are pretty well optimized (for CPU and traffic) and it would be cool to see its benefits in OS X too. But yeah probably we need to add a link to some mac alternative to our website until this is implemented.