Skip to content

Commit

Permalink
v3.0.3 标题匹配优化
Browse files Browse the repository at this point in the history
  • Loading branch information
LuckyPuppy514 committed Apr 7, 2023
1 parent 42160ec commit 2f7fcbc
Show file tree
Hide file tree
Showing 12 changed files with 941 additions and 887 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<!-- 项目信息 -->
<groupId>com.lckp</groupId>
<artifactId>jproxy</artifactId>
<version>3.0.2</version>
<version>3.0.3</version>
<name>JProxy</name>
<description>介于 Sonarr/Radarr 和 Jackett/Prowlarr 之间的代理,主要用于优化查询和提升识别率</description>
<!-- 依赖版本 -->
Expand Down
58 changes: 29 additions & 29 deletions src/main/java/com/lckp/jproxy/Application.java
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
package com.lckp.jproxy;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.EnableAspectJAutoProxy;

/**
*
* <p>
* 主类
* </p>
*
* @author LuckyPuppy514
* @date 2023-03-04
*/
@SpringBootApplication
@MapperScan("com.lckp.jproxy.mapper")
@EnableAspectJAutoProxy(proxyTargetClass = true, exposeProxy = true)
@ServletComponentScan
@EnableCaching
public class Application {

public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}
package com.lckp.jproxy;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.EnableAspectJAutoProxy;

/**
*
* <p>
* 主类
* </p>
*
* @author LuckyPuppy514
* @date 2023-03-04
*/
@SpringBootApplication
@MapperScan("com.lckp.jproxy.mapper")
@EnableAspectJAutoProxy(proxyTargetClass = true, exposeProxy = true)
@ServletComponentScan
@EnableCaching
public class Application {

public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}
30 changes: 30 additions & 0 deletions src/main/java/com/lckp/jproxy/model/FormatResult.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package com.lckp.jproxy.model;

import java.io.Serializable;

import lombok.Getter;
import lombok.Setter;

/**
* <p>
* 格式化结果
* </p>
*
* @author LuckyPuppy514
* @date 2023-04-07
*/
@Getter
@Setter
public class FormatResult implements Serializable {
private static final long serialVersionUID = 1L;

/*
* 格式化结果
*/
private String formatText;

/*
* 剩余信息
*/
private String restText;
}
197 changes: 99 additions & 98 deletions src/main/java/com/lckp/jproxy/service/ISonarrTitleService.java
Original file line number Diff line number Diff line change
@@ -1,98 +1,99 @@
package com.lckp.jproxy.service;

import java.util.List;
import java.util.Map;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.lckp.jproxy.entity.SonarrRule;
import com.lckp.jproxy.entity.SonarrTitle;
import com.lckp.jproxy.model.request.SonarrTitleQueryRequest;

/**
* <p>
* SonarrTitle 服务类
* </p>
*
* @author LuckyPuppy514
* @since 2023-03-19
*/
public interface ISonarrTitleService extends IService<SonarrTitle> {
/**
*
* 同步
*
* boolean
*/
public boolean sync();

/**
*
* 查询需要同步 TMDB 标题的 tvdbId
*
* @return List<Integer>
*/
public List<Integer> queryNeedSyncTmdbTitle();

/**
*
* 根据标题查询
*
* @param title
* @return SonarrTitle
*/
public SonarrTitle queryByTitle(String title);

/**
*
* 查询所有标题
*
* @return List<SonarrTitle>
*/
public List<SonarrTitle> queryAll();

/**
*
* 格式化标题
*
* @param text
* @param format
* @param cleanTitleRegex
* @param sonarrRuleList
* @param sonarrTitleList
* @return String
*/
public String formatTitle(String text, String format, String cleanTitleRegex,
List<SonarrRule> sonarrRuleList, List<SonarrTitle> sonarrTitleList);

/**
*
* 格式化
*
* @param text
* @param format
* @param tokenRuleMap
* @return String
*/
public String format(String text, String format, Map<String, List<SonarrRule>> tokenRuleMap);

/**
*
* 格式化并缓存
*
* @param text
* @param format
* @param tokenRuleMap
* @return String
*/
public String formatWithCache(String text, String format, Map<String, List<SonarrRule>> tokenRuleMap);

/**
*
* 分页查询
*
* @param request
* @return IPage<SonarrTitle>
*/
public IPage<SonarrTitle> query(SonarrTitleQueryRequest request);
}
package com.lckp.jproxy.service;

import java.util.List;
import java.util.Map;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.lckp.jproxy.entity.SonarrRule;
import com.lckp.jproxy.entity.SonarrTitle;
import com.lckp.jproxy.model.FormatResult;
import com.lckp.jproxy.model.request.SonarrTitleQueryRequest;

/**
* <p>
* SonarrTitle 服务类
* </p>
*
* @author LuckyPuppy514
* @since 2023-03-19
*/
public interface ISonarrTitleService extends IService<SonarrTitle> {
/**
*
* 同步
*
* boolean
*/
public boolean sync();

/**
*
* 查询需要同步 TMDB 标题的 tvdbId
*
* @return List<Integer>
*/
public List<Integer> queryNeedSyncTmdbTitle();

/**
*
* 根据标题查询
*
* @param title
* @return SonarrTitle
*/
public SonarrTitle queryByTitle(String title);

/**
*
* 查询所有标题
*
* @return List<SonarrTitle>
*/
public List<SonarrTitle> queryAll();

/**
*
* 格式化标题
*
* @param text
* @param format
* @param cleanTitleRegex
* @param sonarrRuleList
* @param sonarrTitleList
* @return FormatResult
*/
public FormatResult formatTitle(String text, String format, String cleanTitleRegex,
List<SonarrRule> sonarrRuleList, List<SonarrTitle> sonarrTitleList);

/**
*
* 格式化
*
* @param text
* @param format
* @param tokenRuleMap
* @return String
*/
public String format(String text, String format, Map<String, List<SonarrRule>> tokenRuleMap);

/**
*
* 格式化并缓存
*
* @param text
* @param format
* @param tokenRuleMap
* @return String
*/
public String formatWithCache(String text, String format, Map<String, List<SonarrRule>> tokenRuleMap);

/**
*
* 分页查询
*
* @param request
* @return IPage<SonarrTitle>
*/
public IPage<SonarrTitle> query(SonarrTitleQueryRequest request);
}
Loading

0 comments on commit 2f7fcbc

Please sign in to comment.