Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Watch time statistics #739

Closed
2 tasks done
Paralusion opened this issue Aug 14, 2020 · 2 comments
Closed
2 tasks done

Watch time statistics #739

Paralusion opened this issue Aug 14, 2020 · 2 comments

Comments

@Paralusion
Copy link

Feature request

Watch time

  • I understand the difference between Streamlink and Streamlink Twitch GUI.
  • This is a feature request and I have read the contribution guidelines.

Description

Watch time per channel.
When clicking on someone channel, it shows the channel statistics. A bit of text could be added to show the user how long they have watched a particular channel for.

Additional comments, screenshots, etc.

@bastimeyer
Copy link
Member

For that to happen, first, the currently used localstorage-based ember-data adapter (ember-localstorage-adapter) needs to be replaced with an alternative data adapter that is built on an index structure, because storing watch time statistics and related data requires a data structure which can be accessed faster without having to have everything in memory at the same time. The localstorage-adapter doesn't fit here, as it's just one giant JSON object loaded into memory, and storing watch stats will make this grow larger and larger over time, which will eventually become a problem, especially if it's read and written a lot. Not to mention that it's a synchronous API and could therefore block the DOM rendering if the data is too large.

Two options for the replacement are

  • ember-localforage-adapter
    Based on Mozilla's localForage, which has a driver for the IndexedDB API. localForage is a bit dated though and the ember-data adapter doesn't seem to be actively maintained. I also don't agree with its implementation to 100%.
  • ember-pouch
    Based on PouchDB, which has an adapter for the IndexedDB API. This may be a bit too much of an overkill though, but at least it's actively maintained.

Replacing the data adapter means that all the currently implemented models using this adapter, namely the settings, channel settings, window position, auth and versioncheck need to be converted, in addition to the localstorage instance initializer, which fixes old data schemes. That will be a bit of work, as everything needs to stay compatible when upgrading the app from an older version.

As a conclusion, the implementation effort for having a simple watch-time-stats feature alone is way too high. However, by changing the data adapter for locally stored data, which is something I've had in mind since years, other features could be implemented way easier, like a watch history for example.

@bastimeyer bastimeyer changed the title Feature request: watch time Watch time statistics Aug 16, 2020
@Paralusion
Copy link
Author

I understand that this is seen as low priority for now, as the amount of work for just one little feature is tremendous. If you're ever planning on implementing user statistics, things such as "recently/last watched" and streamer sorting by "most watched" etc could also be implemented. Good luck and thanks for the detailed reply.

@bastimeyer bastimeyer closed this as not planned Won't fix, can't repro, duplicate, stale May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants