jidoujisho icon indicating copy to clipboard operation
jidoujisho copied to clipboard

Add read time stats

Open mathewthe2 opened this issue 2 years ago • 13 comments

Ever since I've added a read time tracker to my reader app, I've found it helpful to keep my self consistent and accountable.

Having these stats for jidoujisho would be great:

  • daily read time / goal
  • reading streak
  • read time per page (for particular book or globally)
  • characters read per minute (for particular book or globally)

The main difficulty for tracking read time is detecting when the user sleeps the app (switches apps / turns off screen) and when they restart the app to read.

  Future<void> handleAppResume() async {
    startLocalAssetsServer();
    profileProvider?.restartSession();
  }

  Future<void> handleAppSleep() async {
    stopLocalAssetsServer();
    profileProvider?.endSession();
  }

  @override
  void didChangeAppLifecycleState(AppLifecycleState state) {
    super.didChangeAppLifecycleState(state);
    switch (state) {
      case AppLifecycleState.resumed:
        handleAppResume();
        break;
      case AppLifecycleState.inactive:
      case AppLifecycleState.paused:
      case AppLifecycleState.detached:
        handleAppSleep();
        break;
    }
  }

mathewthe2 avatar Jan 27 '23 02:01 mathewthe2

I've decided in regards to this issue, I might wait on @KamWithK and integrate with exSTATic at some point in the future (when an API is for it becomes ready).

I know this is something that people really want, but I think it would be best if I can let other developers do what they do best and I can focus on areas that I have to implement solely on my own -- it would potentially be more feature-rich than any simple solution I work on too.

arianneorpilla avatar Mar 29 '23 23:03 arianneorpilla

Getting stat tracking right is really crucial for immersion learning so I'm super glad to work on providing a way for exSTATic to integrate with apps like Jidoujisho! I've got pretty much all the graphs you would want (happy to add more too), so keen to enable more people to use it.

Jidoujisho will definitely be one of the first new integrations (if not the first) with exSTATic, but to be clear the rework will probably take at least a few months (on pause currently due to how busy I am with other stuff). Hope the wait is okay @lrorpilla :)

KamWithK avatar Mar 30 '23 00:03 KamWithK

So can everything be run locally on my phone without internet or is this going to be a cloud service or has to be hosted on my computer?

mathewthe2 avatar Mar 30 '23 02:03 mathewthe2

It currently works via an offline webextension but I'm re-architecting it as an online cloud service, so it can be used across devices and with several integrations like Jidoujisho. Offline support will be a feature re-added in after everything has been finalised and I see people using the new one 👍

KamWithK avatar Mar 30 '23 03:03 KamWithK

It currently works via an offline webextension

I mean can it be embedded into this app as an offline module?

mathewthe2 avatar Mar 30 '23 03:03 mathewthe2

Eventually things will be worked out It will require work on both our ends but it should be doable in due time (not sure if that's the answer you were looking for but it's as good an answer as can be provided by me currently)

KamWithK avatar Apr 05 '23 05:04 KamWithK

Any updates on this? This is the only thing missing to make it perfect.

NielsVandenEynde avatar Nov 17 '23 20:11 NielsVandenEynde

This hasn't been a priority but I have got auth working, I just need to get a sync server for stats up, confirm it works for exSTATic website and then we can integrate (if jidoujisho is still keen on exSTATic support)

KamWithK avatar Nov 17 '23 22:11 KamWithK

Ttsu reader now has stats, for the time being Jidoujisho could change to use https://reader.ttsu.app/ so we have stats on the reader

ElaxDev avatar Feb 20 '24 04:02 ElaxDev

yeah we need an update on this. can anyone contact him in TMW's discord? he may not be reading through the issue tracker.

brishtibheja avatar Feb 20 '24 10:02 brishtibheja

Rest assured I am reading all this. I am working on something and it will take time.

arianneorpilla avatar Feb 20 '24 10:02 arianneorpilla

Hey, will ttu reader be updated or we will need to wait until you finish the new version?

brishtibheja avatar Feb 20 '24 10:02 brishtibheja

@lrorpilla Can you at least release a new preview version with updated ttu reader? That will get us the stats. The new stuff you're working on might take more time so releasing a new ver. in the recent future will be really helpful.

brishtibheja avatar Jun 14 '24 20:06 brishtibheja