Giter VIP home page Giter VIP logo

Comments (19)

i96751414 avatar i96751414 commented on July 17, 2024

Although I think this is a good idea, this will be an hard thing to do, because it relies on the scrapper you are currently using...

from plugin.video.quasar.

 avatar commented on July 17, 2024

@i96751414, I don't know if it is the same, but I have some code in my viewer for check if the movie/show is already added in the local library

`# Search if a video is already in Kodi Database
def existInKodiLibrary(id, season="1", episode="1"):
import json

result = False
if 'tt' in id:
    # Movies
    query = {
        'jsonrpc': '2.0',
        'id': 0,
        'method': 'VideoLibrary.GetMovies',
        'params': {
            'properties': ['imdbnumber', 'file']
        }
    }
    response = json.loads(xbmc.executeJSONRPC(json.dumps(query)))
    movieDict = dict(
        (movie['imdbnumber'], movie['file'])
        for movie in response.get('result', {}).get('movies', [])
    )
    if movieDict.has_key(id):
        result = True
else:
    # TV Shows
    query = {
        'jsonrpc': '2.0',
        'id': 0,
        'method': 'VideoLibrary.GetTVShows',
        'params': {
            'properties': ['imdbnumber', 'file', 'season', 'episode']
        }
    }
    response = json.loads(xbmc.executeJSONRPC(json.dumps(query)))
    showDict = dict(
        (show['imdbnumber'] + "-" + str(show['season']) + "-" + str(show['episode']), show['file'])
        for show in response.get('result', {}).get('tvshows', [])
    )
    if showDict.has_key(id + "-" + str(season) + "-" + str(episode)):
        result = True
return result`

The way to use it is with IMDB ID for movies and TVDB ID, season and episode for TV shows;

`existInKodiLibrary("TT000000") # it will check for that movie

existInKodiLibrary("0000", 1, 1) # it will check for tv show.
`

I wanted to add to the code, but it think that part is in golang :p

from plugin.video.quasar.

i96751414 avatar i96751414 commented on July 17, 2024

Right, I had the same idea, basically using IMDBID and TVDBID should work fine. But what if the user is using other scrapper? That's what i was trying to say

from plugin.video.quasar.

i96751414 avatar i96751414 commented on July 17, 2024

Anyway, hopefully I will start working on this next week

from plugin.video.quasar.

 avatar commented on July 17, 2024

It doesn't matter which scrapper, because it is kodi database which has all the info at the end.

from plugin.video.quasar.

i96751414 avatar i96751414 commented on July 17, 2024

I was talking about kodi's scrappers... But I hope you're right..

from plugin.video.quasar.

 avatar commented on July 17, 2024

With that code, I didn't have any problems with the user preference scraper

from plugin.video.quasar.

scakemyer avatar scakemyer commented on July 17, 2024

@i96751414 Any updates on this? Sorry I had to make changes to api/library.go with the switch to TMDB, hope I didn't create conflicts if you were working on this meanwhile.

from plugin.video.quasar.

drake0101 avatar drake0101 commented on July 17, 2024

+1 for duplicates handling.
In my case its tv shows. For example: I already have season 1 on my hdd (and in Kodi's library). The Show has been renewed and now there is a second season available via Quasar. It would be awesome if I add to library the whole TV show in Quasar, but it would only add missing episodes (in this case episodes from season 2).

from plugin.video.quasar.

kingdingaling83 avatar kingdingaling83 commented on July 17, 2024

did this ever get added as a feature?

from plugin.video.quasar.

scakemyer avatar scakemyer commented on July 17, 2024

Not yet, still planned for v1.0

from plugin.video.quasar.

kingdingaling83 avatar kingdingaling83 commented on July 17, 2024

thank you so much!
i cannot wait... loving your hard work!

from plugin.video.quasar.

kingdingaling83 avatar kingdingaling83 commented on July 17, 2024

i'm not sure if i'm missing something but i updated to the latest Quasar to test this feature.

  • i have seasons 1-4 of Bobs Burgers locally downloaded
  1. i chose add to library Bobs Burgers from Trakt inside quasar

  2. Quasar added duplicates of episodes i already had locally

i tried with the setting 'ignore duplicates' off and on

from plugin.video.quasar.

scakemyer avatar scakemyer commented on July 17, 2024

As @i96751414 mentioned last year, local library IDs depend on the scraper being used. Movies seem to reliably have their IMDB id set, but shows look like they get whatever ID scrapers give them. Since Quasar is using TMDB IDs for both, I've implemented the feature using those until I find a better solution, probably a setting to specify which scraper IDs it should use, and should probably default to TVDB also.

from plugin.video.quasar.

kingdingaling83 avatar kingdingaling83 commented on July 17, 2024

well that might be it as i use local nfo files for my local content
ok i'll give that a go

from plugin.video.quasar.

scakemyer avatar scakemyer commented on July 17, 2024

@kingdingaling83 Releasing v0.9.42 shortly with the setting for which scraper IDs you're using (TVDB, TMDB or Trakt)

from plugin.video.quasar.

kingdingaling83 avatar kingdingaling83 commented on July 17, 2024

Trackt would be ideal as i have different folders using different scrapers so i'll try this tonight

from plugin.video.quasar.

kingdingaling83 avatar kingdingaling83 commented on July 17, 2024

I've just tested using trakt as the scraper.
still getting duplicates.

i checked trakt and i only have 42 episodes of bobs burgers in my collection but they ones in my collect get re-added

from plugin.video.quasar.

scakemyer avatar scakemyer commented on July 17, 2024

The setting basically just tells Quasar what type of IDs it should expect for shows in your library. If you have different scrapers/IDs there's obviously duplicates it will miss. It's not telling Quasar which scraper to use, it's telling it which one you are using for your library.

from plugin.video.quasar.

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.