Exemplo n.º 1
0
func showEpisodeLinks(showId string, seasonNumber, episodeNumber int) ([]*bittorrent.Torrent, error) {
	log.Println("Searching links for TVDB Id:", showId)

	show, err := tvdb.NewShowCached(showId, config.Get().Language)
	if err != nil {
		return nil, err
	}

	episode := show.Seasons[seasonNumber].Episodes[episodeNumber-1]

	log.Printf("Resolved %s to %s\n", showId, show.SeriesName)

	searchers := providers.GetEpisodeSearchers()
	if len(searchers) == 0 {
		xbmc.Notify("Quasar", "LOCALIZE[30204]", config.AddonIcon())
	}

	return providers.SearchEpisode(searchers, show, episode), nil
}
Exemplo n.º 2
0
func showEpisodeLinks(showId int, seasonNumber int, episodeNumber int) ([]*bittorrent.Torrent, string, error) {
	log.Println("Searching links for TMDB Id:", showId)

	show := tmdb.GetShow(showId, config.Get().Language)
	season := tmdb.GetSeason(showId, seasonNumber, config.Get().Language)
	if season == nil {
		return nil, "", errors.New("Unable to find season")
	}

	episode := season.Episodes[episodeNumber-1]

	log.Printf("Resolved %d to %s", showId, show.Name)

	searchers := providers.GetEpisodeSearchers()
	if len(searchers) == 0 {
		xbmc.Notify("Quasar", "LOCALIZE[30204]", config.AddonIcon())
	}

	longName := fmt.Sprintf("%s S%02dE%02d", show.Name, seasonNumber, episodeNumber)

	return providers.SearchEpisode(searchers, show, episode), longName, nil
}
Exemplo n.º 3
0
func showEpisodeLinks(showId int, seasonNumber int, episodeNumber int) ([]*bittorrent.Torrent, error) {
	log.Println("Searching links for TMDB Id:", showId)

	show := tmdb.GetShow(showId, config.Get().Language)
	season := tmdb.GetSeason(showId, seasonNumber, config.Get().Language)
	if season == nil {
		return nil, errors.New("Unable to find season")
	}

	episode := season.Episodes[episodeNumber-1]

	log.Printf("Resolved %d to %s", showId, show.Name)

	if torrents := InTorrentsMap(strconv.Itoa(episode.Id)); len(torrents) > 0 {
		return torrents, nil
	}

	searchers := providers.GetEpisodeSearchers()
	if len(searchers) == 0 {
		xbmc.Notify("Quasar", "LOCALIZE[30204]", config.AddonIcon())
	}

	return providers.SearchEpisode(searchers, show, episode), nil
}