Ejemplo n.º 1
0
  public static boolean doHuluCBS(MyLibraryFile video, boolean isHulu, boolean isCBS) {
    String matchingPattern = null;
    if (!video.knownType() || video.isTvShow()) {
      Pattern seasonEpisodePattern = Pattern.compile("s[0-9]+e[0-9]+", Pattern.CASE_INSENSITIVE);
      Matcher seasonEpisodeMatcher = seasonEpisodePattern.matcher(video.getFullPath());
      boolean match = seasonEpisodeMatcher.find();
      if (match) {
        matchingPattern = seasonEpisodeMatcher.group();
        video.setType(TV_SHOW);
      } else if (!video.isTvShow()) // dont over-ride config param
      video.setType(MOVIE);
    }

    boolean success;
    if (video.isTvShow()) success = addHuluOrCBSTvEpisodeMetaData(video, matchingPattern);
    else if (video.isMovie()) {
      video.setTitle(video.getFileLabel());
      success = valid(video.getTitle());
    } else // do hulu/cbs have music videos?
    {
      Logger.WARN(
          "Cannot Archive: Type of content cannot be auto-determined for Hulu video: "
              + video.getFullPathEscaped());
      success = false;
    }

    Logger.DEBUG(
        (isCBS ? "CBS" : "Hulu")
            + ": success="
            + success
            + "; "
            + (video.isTvShow()
                ? "TV: series="
                    + video.getSeries()
                    + "; title="
                    + video.getTitle()
                    + ", "
                    + "season="
                    + video.getSeasonNumber()
                    + ", episode="
                    + video.getEpisodeNumber()
                : "Movie: " + video.getTitle())
            + " --- "
            + video.getFullPathEscaped());
    return success;
  }
Ejemplo n.º 2
0
 public static void copyVideoMetaData(MyLibraryFile source, MyLibraryFile dest) {
   dest.setTitle(source.getTitle());
   dest.setType(source.getType());
   dest.setArtist(source.getArtist());
   dest.setEpisodeNumber(source.getEpisodeNumber());
   dest.setFileLabel(source.getFileLabel());
   dest.setFinalLocation(source.getFinalLocation());
   dest.setHasBeenLookedUpOnTVDB(source.hasBeenLookedUpOnTVDB());
   dest.setMultiFileVideo(source.isMultiFileVideo());
   dest.setOriginalAirDate(source.getOriginalAirDate());
   if (source.isDuplicate()) dest.setAsDuplicateTo(source.getOriginalVideo());
   else dest.setOriginalVideo(source.getOriginalVideo());
   dest.setSeasonNumber(source.getSeasonNumber());
   dest.setSeries(source.getSeries());
   dest.setSkippedBecauseAlreadyArchived(source.skippedBecauseAlreadyArchived);
   dest.setSubfolder(source.getSubfolder());
   dest.setTVDBId(source.getTVDBId());
   dest.setYear(source.getYear());
 }