Skip to content

Commit

Permalink
注释
Browse files Browse the repository at this point in the history
  • Loading branch information
wushuo894 committed Nov 18, 2024
1 parent df4bc7e commit 68a1abe
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 9 deletions.
44 changes: 35 additions & 9 deletions src/main/java/ani/rss/download/BaseDownload.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,63 +12,89 @@

public interface BaseDownload {

/**
* 视频格式
*/
List<String> videoFormat = List.of("mp4", "mkv", "avi", "wmv");

/**
* 字幕格式
*/
List<String> subtitleFormat = List.of("ass", "ssa", "sub", "srt", "lyc");

/**
* 登录
*
* @return
* @param config 设置
* @return 登录状态
*/
Boolean login(Config config);

/**
* 获取任务列表
*
* @return
* @return 任务列表
*/
List<TorrentsInfo> getTorrentsInfos();

/**
* 下载
*
* @param item
* @param savePath
* @param torrentFile
* @param item 下载项
* @param savePath 保存位置
* @param torrentFile 种子文件
* @param ova 是否剧场版/OVA
* @return 下载状态
*/
Boolean download(Item item, String savePath, File torrentFile, Boolean ova);

/**
* 删除已完成任务
*
* @param torrentsInfo
* @param torrentsInfo 任务
* @param deleteFiles 删除本地文件
* @return 删除状态
*/
Boolean delete(TorrentsInfo torrentsInfo, Boolean deleteFiles);

/**
* 重命名
*
* @param torrentsInfo
* @param torrentsInfo 任务
*/
void rename(TorrentsInfo torrentsInfo);

/**
* 为任务添加标签
*
* @param torrentsInfo 任务
* @param tags 标签
* @return 状态
*/
Boolean addTags(TorrentsInfo torrentsInfo, String tags);

/**
* 自动更新 Trackers
*
* @param trackers trackers 列表
*/
void updateTrackers(Set<String> trackers);

/**
* 修改保存位置
*
* @param torrentsInfo
* @param path
* @param torrentsInfo 任务
* @param path 位置
*/
void setSavePath(TorrentsInfo torrentsInfo, String path);

/**
* 获取重命名结果
*
* @param name 文件名
* @param reName 重命名
* @return 最终命名
*/
default String getFileReName(String name, String reName) {
String ext = FileUtil.extName(name);
if (StrUtil.isBlank(ext)) {
Expand Down
8 changes: 8 additions & 0 deletions src/main/java/ani/rss/util/AlistUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
import java.util.concurrent.ExecutorService;
import java.util.concurrent.LinkedBlockingQueue;

/**
* Alist
*/
@Slf4j
public class AlistUtil {
private static final ExecutorService EXECUTOR = ExecutorBuilder.create()
Expand All @@ -24,6 +27,11 @@ public class AlistUtil {
.setWorkQueue(new LinkedBlockingQueue<>(256))
.build();

/**
* 将下载完成的任务上传至Alist
*
* @param torrentsInfo 任务
*/
public static void upload(TorrentsInfo torrentsInfo) {
Config config = ConfigUtil.CONFIG;
Boolean alist = config.getAlist();
Expand Down

0 comments on commit 68a1abe

Please sign in to comment.