Jump to content


Photo

Developing a standalone embystat server

emby statistics server

  • Please log in to reply
248 replies to this topic

#41 GugZi OFFLINE  

GugZi

    Newbie

  • Members
  • 9 posts
  • Local time: 10:22 AM

Posted 10 July 2018 - 07:00 AM

@reggi I think u should chance the default port(5000), then the same port is being used by https://ombi.io



#42 darkassassin07 OFFLINE  

darkassassin07

    Advanced Member

  • Members
  • 532 posts
  • Local time: 03:22 AM

Posted 10 July 2018 - 08:29 AM

@reggi I think u should chance the default port(5000), then the same port is being used by https://ombi.io


If this server/app is using the same port as ombi, they wont be able to co-exist on the same system as you can't bind two apps to to the same port.
Do you mean change the port to something else because ombi uses the same port already? (im not familiar with ombi)

#43 reggi OFFLINE  

reggi

    Advanced Member

  • Members
  • 331 posts
  • Local time: 12:22 PM
  • LocationAntwerp, Belgium

Posted 10 July 2018 - 08:33 AM

LIke @darkassassin07 said, I'm not going to take the same port as Ombi since users will not be able to run both servers on the same machine. 

In the end, I want to make the port changeable in config, but I'm not there yet!

 

I will upload a new Beta version this evening and post a changelog asap as well. A lot has changed since the last update, sorry it took me some time.

There will be no updating logic yet, so when a new release is pushed you will have to remove this version and install the new one (and you will lose your data).



#44 GugZi OFFLINE  

GugZi

    Newbie

  • Members
  • 9 posts
  • Local time: 10:22 AM

Posted 10 July 2018 - 08:40 AM

i know that 2 programs can't run on the same port.. that why i say (you should change default port to something else) then i run EmbyStat.Web.exe it run on port 5000. just like ombi, så i can't run both at the same time



#45 reggi OFFLINE  

reggi

    Advanced Member

  • Members
  • 331 posts
  • Local time: 12:22 PM
  • LocationAntwerp, Belgium

Posted 10 July 2018 - 08:44 AM

Haaa ok ok, you can always run the docker image and pick your own port.

Or there is a command option so you can pick your own port number for a dotnet app. I will look into that and give you an update when I have found it.



#46 reggi OFFLINE  

reggi

    Advanced Member

  • Members
  • 331 posts
  • Local time: 12:22 PM
  • LocationAntwerp, Belgium

Posted 10 July 2018 - 05:45 PM

Hey guys,

 

So I just pushed a new version to my beta branch, you can find all release files here https://github.com/m...byStat/releases or just get them with docker tags beta-linux and beta-win.

Feel free to test it, give feedback here or create issues on the github repo.

 

Some changes that are done:

  • Movie stats added
  • Show stats added
  • Added support for missing episodes (TVDB)
  • Downloadable log files
  • Rework "Movie sync" task to "Media sync" task
  • Expanded settings page with tabs
  • Using database caching system for statistics
  • Added task feedback on task page

This is still a basic version, so no update mechanism is included (meaning that with a new version you will have to remove this one completely first). I'm still working on an updater!

I already did some work to get life events from Emby, but I will first fig all bugs that I have on my backlog before creating new features.

 

If you have any design ideas, new features feel free to post here or create a new github issue. So I can keep track of all useful ideas.

 

I hope you guys like it so far!


  • Abobader, Happy2Play and neik like this

#47 Happy2Play OFFLINE  

Happy2Play

    Trial and Error

  • Moderators
  • 13847 posts
  • Local time: 03:22 AM
  • LocationWashington State

Posted 10 July 2018 - 07:00 PM

@reggi

 

You will need to update all urls with the "/index.html#!/" change in current beta that will be stable released any day now.

 

https://emby.media/c...hl=index.html#!


Edited by Happy2Play, 10 July 2018 - 07:43 PM.

  • reggi likes this

#48 reggi OFFLINE  

reggi

    Advanced Member

  • Members
  • 331 posts
  • Local time: 12:22 PM
  • LocationAntwerp, Belgium

Posted 11 July 2018 - 02:49 AM

@Happy2Play 

 

Thanks, forgot about that!

 

EDIT (to prevent double post)

 

I made an account on crowdin for the translations. Feel free to translate the app in your language here: https://crowdin.com/project/embystat

At this moment there are some standard languages included in the app, if your language is not there and you want EmbyStat in your language, PM me and I will add the language for you.

 

Also not sure if it makes sense to divide en-us and en-uk, let me know if I have to! Feel free to also check my English since it's not that perfect :P 


Edited by reggi, 11 July 2018 - 05:33 AM.


#49 candyman OFFLINE  

candyman

    Advanced Member

  • Alpha Testers
  • 60 posts
  • Local time: 11:22 AM
  • LocationScunthorpe, UK

Posted 11 July 2018 - 08:24 AM

@reggi where would you like error reports posting, are they ok here ?



#50 reggi OFFLINE  

reggi

    Advanced Member

  • Members
  • 331 posts
  • Local time: 12:22 PM
  • LocationAntwerp, Belgium

Posted 11 July 2018 - 08:26 AM

@candyman 

 

I do prefer a github issue. But if you don't have a github account you can post them here yes.



#51 candyman OFFLINE  

candyman

    Advanced Member

  • Alpha Testers
  • 60 posts
  • Local time: 11:22 AM
  • LocationScunthorpe, UK

Posted 11 July 2018 - 08:27 AM

@candyman 

 

I do prefer a github issue. But if you don't have a github account you can post them here yes.

 

@reggi no problem will get it reported on github


  • reggi likes this

#52 reggi OFFLINE  

reggi

    Advanced Member

  • Members
  • 331 posts
  • Local time: 12:22 PM
  • LocationAntwerp, Belgium

Posted 16 July 2018 - 04:38 AM

Hey guys,

 

Just release a new beta version (still no update mechanism, so update manually), version 0.1.0.22-beta with some bug fixes.

Feel free to give your opinion on the tool!

 

Next step is to sync the live user data with EmbyStat and fix some graph issues for both shows and movie statistics.


Edited by reggi, 16 July 2018 - 04:51 AM.


#53 adrianwi OFFLINE  

adrianwi

    Advanced Member

  • Members
  • 320 posts
  • Local time: 11:22 AM
  • LocationScotland

Posted 16 July 2018 - 02:29 PM

I've got this running in Docker using the beta-linux image and it starts up ok and appear to connect to my emby server, but when I try and start a sync task it errors.  The log shows this:

2018-07-16 18:24:32 [INF] Booting up server
2018-07-16 18:24:33 [INF] Migrating database started
2018-07-16 18:24:34 [INF] Migrating database ended
2018-07-16 18:24:35 [INF] Daily trigger for TASKS.SMALLEMBYSYNCTITLE set to fire at 07/17/2018 00:30:00, which is 365.41545797 minutes from now.
2018-07-16 18:24:35 [INF] Daily trigger for TASKS.MEDIASYNCTITLE set to fire at 07/17/2018 00:00:00, which is 335.414757933333 minutes from now.
2018-07-16 18:24:43 [INF] Getting server configuration from database.
2018-07-16 18:24:46 [INF] Getting server configuration from database.
2018-07-16 18:24:51 [INF] Getting all background tasks.
2018-07-16 18:24:57 [INF] Daily trigger for TASKS.MEDIASYNCTITLE set to fire at 07/17/2018 00:00:00, which is 335.041048185 minutes from now.
2018-07-16 18:24:59 [INF] Executing TASKS.PINGEMBYSERVERTITLE
2018-07-16 18:24:59 [INF] TASKS.PINGEMBYSERVERTITLE "Completed" after 0 minute(s) and 0 seconds
2018-07-16 18:24:59 [INF] ExecuteQueuedTasks
2018-07-16 18:25:03 [INF] Executing TASKS.MEDIASYNCTITLE
2018-07-16 18:25:03 [INF] First delete all existing media and root media collections from database so we have a clean start.
2018-07-16 18:25:03 [INF] Lets start processing movies
2018-07-16 18:25:03 [INF] Asking for all root views for admin user with id 79ad4cab3c4845869e1c5652acb34476
2018-07-16 18:25:03 [INF] Found 1 movie root items, getting ready for processing
2018-07-16 18:25:03 [INF] Asking Emby all movies for parent (f137a2dd21bbc1b99aa5c0f6bf02a805) Movies
2018-07-16 18:25:09 [INF] Ready to add movies to database. We found 631 movies
2018-07-16 18:25:09 [ERR] Error
System.ArgumentNullException: Value cannot be null.
Parameter name: source
   at System.Linq.Enumerable.Select[TSource,TResult](IEnumerable`1 source, Func`2 selector)
   at EmbyStat.Common.Converters.MovieHelper.ConvertToMovie(BaseItemDto x) in /opt/teamcity/work/aa794b64fcf59423/EmbyStat.Common/Converters/MovieHelper.cs:line 15
   at System.Linq.Enumerable.SelectArrayIterator`2.ToList()
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at EmbyStat.Tasks.Tasks.MediaSyncTask.<ProcessMovies>d__21.MoveNext() in /opt/teamcity/work/aa794b64fcf59423/EmbyStat.Tasks/Tasks/MediaSyncTask.cs:line 105
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at EmbyStat.Tasks.Tasks.MediaSyncTask.<Execute>d__19.MoveNext() in /opt/teamcity/work/aa794b64fcf59423/EmbyStat.Tasks/Tasks/MediaSyncTask.cs:line 75
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at EmbyStat.Tasks.ScheduledTaskWorker.<ExecuteInternal>d__54.MoveNext() in /opt/teamcity/work/aa794b64fcf59423/EmbyStat.Tasks/ScheduledTaskWorker.cs:line 231
2018-07-16 18:25:09 [INF] TASKS.MEDIASYNCTITLE "Failed" after 0 minute(s) and 5 seconds
2018-07-16 18:25:09 [INF] ExecuteQueuedTasks



#54 jaspalgill OFFLINE  

jaspalgill

    Advanced Member

  • Members
  • 45 posts
  • Local time: 10:22 AM

Posted 16 July 2018 - 06:41 PM

I had a similar issue on the previous beta version but on Windows 64-bit, where it would connect to the server but never start the sync.

 

However, I've now gone to the latest docker image using Ubuntu and I'm now getting further. I have a couple of media libraries for Documentaries, Comedy, Fitness and Movies.

It's a large library but not massive compared to what I've seen on the forums, how long are people seeing their initial sync process take to complete?

 

I assume the below log is saying it took 6 minutes to add the 30,735 people, is this the process where the local database is being created/populated? It actually took another 5 minutes before it started to import the movies.

My other libraries such as Documentaries, Comedy and Fitness took only seconds, however there are only at most 200 items there.

 

23:27:50 - Ready to add movies to database. We found 1586 movies
23:27:51 - Need to add 10 genres first (Fantasy, Horror, Musical, Mystery, News, Romance, Science Fiction, Sci-Fi, War, Western)
23:33:49 - Need to add 30735 people first
...import
23:52:03 - Media syncronisation is finished.

Edited by jaspalgill, 16 July 2018 - 06:55 PM.


#55 Happy2Play OFFLINE  

Happy2Play

    Trial and Error

  • Moderators
  • 13847 posts
  • Local time: 03:22 AM
  • LocationWashington State

Posted 16 July 2018 - 07:05 PM

I believe EmbyStats currently only looks at content type Movies and TV, as my Unset/Mixed Content library is not detected.



#56 pir8radio OFFLINE  

pir8radio

    Advanced Member

  • Members
  • 2663 posts
  • Local time: 05:22 AM

Posted 16 July 2018 - 08:57 PM

This topic shows promise.   What are your end goals for stats?   User, and server stats too? Maybe a list of stats you plan to supply?  


  • reggi likes this

#57 reggi OFFLINE  

reggi

    Advanced Member

  • Members
  • 331 posts
  • Local time: 12:22 PM
  • LocationAntwerp, Belgium

Posted 17 July 2018 - 03:26 AM

@adrianwi

Did you update your image to the latest version yesterday? If you did, I will create an issue for this on Github.

 

@jaspalgill

Importing the people from Emby to EmbyStat is always the longest process. But only at the first sync, next time it will find only import people that are not yet in your EmbyStat db.

As for the timings, syncing 873 movies and 157 shows took me 11 minutes and 58 seconds (with an I7-7700 at 2,8Ghz). This will decrease more when this bug is fixed. (at the moment all shows are always synced with theTVDB and not just updated)

 

@pir8radio

Thanks for your interest in the project! Here is a small list of stats I still want to include

- Movies boxset count

- File size ( + graph)

- Views/users

- View/time of day

- Views/day of week

...

 

There is still a lot to be done before I can go to a stable release. (update service, notifications, system info, ...)

 

But if you have an idea about something that is missing, feel free to create a new GitHub issue or post it on the forum here.


Edited by reggi, 17 July 2018 - 03:30 AM.

  • jaspalgill likes this

#58 adrianwi OFFLINE  

adrianwi

    Advanced Member

  • Members
  • 320 posts
  • Local time: 11:22 AM
  • LocationScotland

Posted 17 July 2018 - 03:41 AM

I pulled the beta-linux image yesterday, which I assumed was more up to date than latest?



#59 reggi OFFLINE  

reggi

    Advanced Member

  • Members
  • 331 posts
  • Local time: 12:22 PM
  • LocationAntwerp, Belgium

Posted 17 July 2018 - 03:49 AM

Yes indeed, I will remove the latest from docker since that's only used when I build a master release. 

 

Problem you are having has to do with converting the Emby movie objects to EmbyStat movie objects. 

I'll create a new docker image with some more logging enabled (haven't had the time to implement it properly).  



#60 neik OFFLINE  

neik

    Advanced Member

  • Members
  • 506 posts
  • Local time: 12:22 PM

Posted 17 July 2018 - 04:52 AM

Very nice overview!

 

Looking forward to see this developing.

 

Big thanks for your effort so far! :-)


  • reggi likes this





Also tagged with one or more of these keywords: emby, statistics, server

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users