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

Preference system similar to Stremio's in lib/db #7

Open
Ivshti opened this issue Sep 2, 2015 · 8 comments
Open

Preference system similar to Stremio's in lib/db #7

Ivshti opened this issue Sep 2, 2015 · 8 comments
Assignees

Comments

@Ivshti
Copy link
Collaborator

Ivshti commented Sep 2, 2015

It would work like

db.findOne({  imdb_id: ...},[
   { tag: "hd", min_avail: 2 } // prefer HD torrents if they have at least 2 availability
], function(err, torrent) { /* receive torrent */ })

It must be default behaviour to prefer 720p and 1080p torrents if their availability is at least 2

@Ivshti
Copy link
Collaborator Author

Ivshti commented Sep 2, 2015

@jaruba and @sammuel86 - thoughts?

@jaruba
Copy link
Owner

jaruba commented Sep 2, 2015

looks cool, but what if there is no quality tag for the torrents? will all of them simply be discarded with this query?

@jaruba
Copy link
Owner

jaruba commented Sep 2, 2015

oh, i just realized it was a dumb question. :)

@Ivshti
Copy link
Collaborator Author

Ivshti commented Sep 2, 2015

LEt's still answer it - most torrents will be quality tagged, but those which aren't, simply won't be regarded as "preferred" but would still get selected if no preferred torrent is found.

@jaruba
Copy link
Owner

jaruba commented Sep 2, 2015

obviously.. 🎱

@jaruba
Copy link
Owner

jaruba commented Sep 2, 2015

I'm thinking that it would be awesome if quality-grouping was applied to the results of .db.find().

@Ivshti
Copy link
Collaborator Author

Ivshti commented Sep 6, 2015

IMO this should be a separate function. Most of the code to do this stuff is the stremio add-on in the repo, using output from db.lookup + db.get (essentially a db.find, but without getting all torrents at once), getting the picked file (the file in the torrent which corresponds to the query) and deciding if it contains a preferred tag (such as hd) in the .tag array.

Let's summarize how we imagine this and merge with the simplify API issue and roll out the events API and this at the same time as 0.2 release?

IMO if we have db.findOne(query, preferred), grouping by quali won't be necessary

@Ivshti Ivshti self-assigned this Sep 7, 2015
@Ivshti
Copy link
Collaborator Author

Ivshti commented Sep 27, 2015

Actually this is implemented in the addon

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