コード例 #1
0
  /** 获取带截图文件夹的root路径 */
  public static File getShotRoot(
      ShotInfo shotInfo, AnimeEpisode animeEpisode, AnimeInfo animeInfo) {
    if (shotInfo != null) {
      // if (XStringUtils.isNotBlank(shotInfo.getLocalRootPath())) {
      // return new File(shotInfo.getLocalRootPath(), ShotConstants.LOCAL_ROOT_SHOT_PATH);
      // }
    }

    if (animeEpisode != null) {
      if (XStringUtils.isNotBlank(animeEpisode.getShotLocalRootPath())) {
        return new File(
            animeEpisode.getShotLocalRootPath(), ShotCoreConstants.LOCAL_ROOT_SHOT_PATH);
      }

      if (XStringUtils.isNotBlank(animeEpisode.getLocalRootPath())) {
        return new File(animeEpisode.getLocalRootPath(), ShotCoreConstants.LOCAL_ROOT_SHOT_PATH);
      }
    }

    if (animeInfo != null) {
      if (XStringUtils.isNotBlank(animeInfo.getLocalDetailPath())) {
        return new File(animeInfo.getLocalDetailPath(), ShotCoreConstants.LOCAL_ROOT_SHOT_PATH);
      }
    }

    return getShotRootDefault();
  }
コード例 #2
0
  /** 获取带动画文件夹的root路径 */
  public static File getAnimeRoot(AnimeInfo animeInfo, AnimeEpisode animeEpisode) {
    if (animeEpisode != null && XStringUtils.isNotBlank(animeEpisode.getLocalRootPath())) {
      return new File(animeEpisode.getLocalRootPath(), ShotCoreConstants.LOCAL_ROOT_ANIME_PATH);
    }

    if (animeInfo != null && XStringUtils.isNotBlank(animeInfo.getLocalRootPath())) {
      return new File(animeInfo.getLocalRootPath(), ShotCoreConstants.LOCAL_ROOT_ANIME_PATH);
    }

    return getAnimeRootDefault();
  }
コード例 #3
0
  /** 获取动画的detail路径 */
  public static String getDetailPath(AnimeInfo animeInfo, AnimeEpisode animeEpisode) {
    if (animeEpisode != null && XStringUtils.isNotBlank(animeEpisode.getLocalDetailPath())) {
      return animeEpisode.getLocalDetailPath();
    }

    if (animeInfo != null && XStringUtils.isNotBlank(animeInfo.getLocalDetailPath())) {
      return animeInfo.getLocalDetalPath();
    }

    return null;
  }
コード例 #4
0
  /**
   * 获取带动画文件夹的完整detail路径<br>
   * root path/anime/detail path<br>
   */
  public static File getAnimeDetailFolder(AnimeInfo animeInfo, AnimeEpisode animeEpisode) {
    String detailPath = getDetailPath(animeInfo, animeEpisode);

    if (XStringUtils.isNotBlank(detailPath)) {
      return new File(getAnimeRoot(animeInfo, animeEpisode), detailPath);
    }

    // 没有设定detail路径
    return getAnimeRoot(animeInfo, animeEpisode);
  }
コード例 #5
0
  /** 获取截图的detail路径 */
  public static String getDetailPath(
      ShotInfo shotInfo, AnimeEpisode animeEpisode, AnimeInfo animeInfo) {
    // if (shotInfo != null && XStringUtils.isNotBlank(shotInfo.getLocalDetailPath())) {
    // return shotInfo.getLocalDetailPath();
    // }

    if (animeEpisode != null) {
      if (XStringUtils.isNotBlank(animeEpisode.getShotLocalDetailPath())) {
        return animeEpisode.getShotLocalDetailPath();
      }

      if (XStringUtils.isNotBlank(animeEpisode.getLocalDetailPath())) {
        return animeEpisode.getLocalDetailPath();
      }
    }

    if (animeInfo != null) {
      if (XStringUtils.isNotBlank(animeInfo.getLocalDetailPath())) {
        return animeInfo.getLocalDetailPath();
      }
    }

    return null;
  }
コード例 #6
0
  /**
   * 获取带截图文件夹的完整detail路径<br>
   * root path/shot/detail path/number<br>
   */
  public static File getShotDetailFolder(
      ShotInfo shotInfo, AnimeEpisode animeEpisode, AnimeInfo animeInfo) {
    String detailPath = getDetailPath(shotInfo, animeEpisode, animeInfo);

    if (XStringUtils.isNotBlank(detailPath)) {
      File file = new File(getShotRoot(shotInfo, animeEpisode, animeInfo), detailPath);
      if (animeEpisode != null) {
        String number = animeEpisode.getNumber();
        if (number != null) {
          file = new File(file, number);
        }
      }
      return file;
    }

    return getShotRoot(shotInfo, animeEpisode, animeInfo);
  }