Giter Club home page Giter Club logo

Comments (1)

Ivshti avatar Ivshti commented on July 21, 2024

How to re-implement Calendar/Notifications to be add-on based

And as a result, not requiring additional backend work and more importantly, extendable

  • The add-on system would gain "multi" catalogs that return CatalogDetailResp { metasDetailed: Vec<MetaDetail> }; they take a required extra prop ids, which is in the format ["tt0944947", ...]
  • cinemeta/channels and potentially others (#24) implement those, and implement "last-videos" catalog IDs which return a MetaDetail with videos being set to the last N videos; even if cinemeta is static, this can be done via a Cloudflare worker
  • LibAddon would implement resource(s) that the Calendar and Notifications can use directly
    • for example, a new /videos/ resource, with extra prop whereIsNew which allows you to specify either new or non-new videos
    • alternatively, we can use the same CatalogDetailResp but without ids and instead with isNew - seems like the cleaner way to go
  • the LibAddon would query all "last-videos" catalogs with ids set to the most watched series/channels of the user
  • this will happen in an asynchronous tick (in action: UpdateLastVids, out action: LastVidsUpdated); this out action should trigger re-requests of the resources used for Calendar/Notifications
  • if any of the addons errors or times out, we can fallback on our own cache (managed by the LibAddon)
  • results of the resources for Calendar/Notifications can update even offline and without LastVidsUpdated happening: since every time we recalculate the results, some videos that were upcoming might have become available
  • the way we mark notifications as seen is by keeping state.last_video_released for each LibItem; all of the videos where released is larger than state.last_video_released are considered new to the user
    • for new library items, this value won't be set, and we will use the libitem ctime instead
    • compat: we can update this property each time a datastorePut is done for a notif to maintain compatibility with older versions
    • caveat: compraed to the previous system, this obviously cannot keep state for each video individually; this shouldn't be a big issue, since users watch videos in succession and there's also watched (watchedBitfield)

from stremio-core.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.