Jump to content

Developing a standalone embystat server


reggi

Recommended Posts

reggi
5c613d25370ed_logo_color.png
 
all.png total.png embystat.png localized.png embystat.png embystat.png
 
 
EmbyStat is a personal web server that can calculate all kinds of statistics from your (local) Emby server. Just install this on your server and let him calculate all kinds of fun stuff.
 
This project is still in Alpha fase, but feel free to test it on your computer.
 
Packages
Supported platforms as the moment are:
I will try to support as many platforms as possible. More and more will come in the future!
If you have knowledge about building Unix packages please feel free to contact me so I can support as many platforms as possible.
 
Feature request
If you have some crazy idea you want to see implemented in EmbyStat you can create a feature request here => https://embystat.featureupvote.com/
Or just go and upvote your favorite features so I have a better idea about what I should build next.
 
Installation Guides
Go to https://github.com/mregni/EmbyStat/releases and grab the latest release.
The packages are selfcontained so you don't need to install dotnet runtime on your host.
 
Run the server (Kestrel on Windows example)
Embystat.exe --port <port>

Passing a port is optional, default port is 6555

 

 
To host it in a Docker container you can use the following command
docker run -p <port>:6555 -v <hostpath>:/app/config uping/embystat:beta
Translations
Translations are managed with the Crowdin web service. Feel free to help me translate the application in your own language here: https://crowdin.com/project/embystat. If your language is not listed just create a new feature request or ping me.
 
Technology
This project is build from scratch with the following technologies:
  • .NET CORE 2.2
  • LiteDB
  • SignalR
  • NLog
  • Angular 5
  • Rollbar
 
Roadmap
A lot of things need to be done before I can go life with this and publish my first 1.0 release. This will happen when all features from the Emby statistics plugin are implemented in EmbyStat.  
Edited by reggi
  • Like 18
  • Thanks 2
Link to comment
Share on other sites

PenkethBoy

interesting :)

 

Happy to test and give feedback etc

 

need more specifics to see if i can help on the project itself

 

what are you using for the backend to store the "stats"? xml? some db? ....

Link to comment
Share on other sites

reggi

Hey @@PenkethBoy, thanks for the support already!

 

I was thinking of a SQLite db. It is well supported in the CORE framework already and runs on all systems.

Probably I will also need an Emby plugin to send start/stop/user events to the stat server. That way the stat server will get real live viewing data and some kind of viewed history after a while.

 

The most difficult part (for me) is getting it up and running in a good way. No point of starting development full throttle if there is no decent system to install/run the server on various platforms I think.

  • Like 1
Link to comment
Share on other sites

mastrmind11

Any reason you're set on .net core and not something universal like Java/Scala?

Link to comment
Share on other sites

reggi

I have no experience with Java or Scala that's why. And at this moment .net core can run on all platforms as well. 

 

Since java and c# are really close I do can have a look at it and see if I can set it up more easily. 

  • Like 2
Link to comment
Share on other sites

Just use c# on net core.  Anyone running Emby will already have what's needed.

Link to comment
Share on other sites

reggi

@@Luke

The problem with a .net core app is that is will open an ugly console app on windows.

 

So what I was thinking was to use a full .net app for windows and a console application that will run on mono on unix platforms. What you think?

I see you guys did the same with Emby, no?

 

Or did you guys find a way to run a .net core app in the background?

  • Like 1
Link to comment
Share on other sites

After building, this command can change the exe type for windows so that there's no console:

"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\editbin.exe" /subsystem:windows "exe path"

Or you can create two application projects - a windows .net core app for windows, a console app for the other operating systems, and then have them both use a shared library with your actual application code.

  • Like 1
Link to comment
Share on other sites

reggi

Ha super!

 

I will have a look at that editbin exe first!

But it looks like 2 app projects with shared libs is the most pratical way at the moment.

  • Like 1
Link to comment
Share on other sites

  • 4 weeks later...

Don't know if this would be a help or not but take a look at http://tautulli.com/. Tautulli is an open source Plex statistics server that runs onside Plex similar to what you are thinking of doing.

 

I know for a fact that NOT having Tautulli available for Emby has been a reason many people won't switch over to Emby from Plex.  These people just don't want to give up this functionality.

 

Obviously the import routines would need to be different/changed for Emby but other than getting the information into the Tautulli DB it should function almost the same regardless of if the data came from Plex or Emby (with minimal differences).'

 

Definitely worth a hard look to see if this code base can be leveraged.

 

Carlo

  • Like 1
Link to comment
Share on other sites

reggi

@@cayars

 

Thanks for the input, I will definitely look into that one!

At this moment I'm almost done with my first version, but still have to setup my build server to make docker images, .deb packages, ...

 

If that is done I will show some screenshots here to get some feedback from you guys.

  • Like 1
Link to comment
Share on other sites

@@reggi, if you haven't looked at it yet, maybe don't do it. :)

It's a rewrite of an existing stats server so it's quite powerful and feature packed.  It's a lot to live up to. :)

 

If on the other hand you want to play with it but don't have a Plex setup to use to help populate the DB give me a shout and I can zip up a DB from a test system that will have some info in it for you to play with.

 

Carlo

  • Like 1
Link to comment
Share on other sites

reggi

Yeah it will take me some time to get there indeed! :P 

 

i'll PM you if I need a DB to test the Plex setup. Thanks for the support!

Link to comment
Share on other sites

  • 3 weeks later...
reggi

Hey guys, 

 

After a few weeks of development, I have some screens that I can show you all. Of course, there is still a lot that needs to be done but just so you get an idea of what I'm working on. You will notice it looks a lot like Emby, this is because I'm using the same material design.

And most of all, I would love to have some feedback and ideas from everyone. So feel free to past your most crazy ideas here and I'll see what I can do. 

 

Don't worry, lot's of features are still missing (included but not limited to show stats, user stats, full movie stats, ...)

 

I'm also still looking for some guys that want to help me out with the UI design, I'm not good at it, so if anyone wants to spend some time discussing ideas with me or make some mockups, feel free to do so!

 

Thanks for the help in advance! I really hope I can make this side project work for everyone.

post-33776-0-54098400-1524001051_thumb.png

post-33776-0-58707000-1524001060_thumb.png

post-33776-0-33947300-1524001073_thumb.png

post-33776-0-58741200-1524001085_thumb.png

post-33776-0-35308000-1524001096_thumb.png

post-33776-0-81587000-1524001106_thumb.png

post-33776-0-21845400-1524001115_thumb.png

  • Like 5
Link to comment
Share on other sites

PenkethBoy

Hi Reggi

 

Looking forward to giving this a test when you get there

 

One question to kick things off - will your server be able to connect to more than one server at a time?

Link to comment
Share on other sites

reggi

Hi PenkethBoy,

 

At this moment no, maybe in the future, I can implement that as well! It should not be that hard because a "server" is just a row in the database.

Another solution would be that you run multiple instances in separate docker containers.

 

But good idea to allow mulitple servers to connect. I'll make a GitHub issue so I don't forget 

Link to comment
Share on other sites

PenkethBoy

Ok fine 

 

instances of Your server in dockers?

 

Second question - do you anticipate collecting similar info to the new plugin from null_pointer as it would be good to have all info in one place - or maybe import his info via his backup option as its a text file?

Link to comment
Share on other sites

reggi

What info do you mean? I'm not sure I can follow you, or did I miss something (sorry, been some lang nights already ;) )

Link to comment
Share on other sites

PenkethBoy

have a look at Null's plugin and you will see he collects additional info to your plugin

Link to comment
Share on other sites

reggi

Fount it! :) 

Looks cool indeed. I was thinking of including real-time watch info as well into the statistics server. For this I do need to create a new Emby plugin that will connect with the local EmbyStat server.

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...
the-dumb1

@@reggi, I was able to download your code from github and start looking at it.  I really like what you've done and I was attempting to augment it by adding statistics for tags and persons.  Ultimately, I'd like to have a "tag cloud" but really am more interested in being able to list all "persons" both textually and graphically.

 

I don't really know where to start; I've been trying to replicate your MovesPage.html and C# code ... but think I'm coming up short.  A little rusty on coding but am willing to work to help.

 

Can you provide some pointers?

Link to comment
Share on other sites

adrianwi

If you've not seen PlexPy, now named Tautulli, then you really should check it out > http://tautulli.com

 

It's probably the single biggest thing I miss about Plex as it could tell me pretty much anything about what was being played or who was accessing the server.  The fact that it was free (although I did make a donation) and looked fantastic was just a bonus.

 

If you could create something like that for emby I'm sure you'd have lots of people willing to support it.

Edited by adrianwi
  • Like 1
Link to comment
Share on other sites

Happy2Play

If you've not seen PlexPy, now named Tautulli, then you really should check it out > http://tautulli.com

 

It's probably the single biggest thing I miss about Plex as it could tell me pretty much anything about what was being played or who was accessing the server.  The fact that it was free (although I did make a donation) and looked fantastic was just a bonus.

 

If you could create something like that for emby I'm sure you'd have lots of people willing to support it.

 

Did you see post 11 and 12?  :)

Edited by Happy2Play
  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...