mirror of
				https://github.com/LamGC/ContentGrabbingJi.git
				synced 2025-11-04 02:26:57 +00:00 
			
		
		
		
	[Fix] CacheStoreCentral 修复Search命令中'option'参数区分大小写的问题;
[Fix] BotCommandProcess 修复Search命令中遇到不存在作品时会中断处理的问题; [Change] BotCommandProcess 调整Ranking命令的'type'参数默认值(ILLUST -> ALL);
This commit is contained in:
		@ -141,7 +141,7 @@ public class BotCommandProcess {
 | 
			
		||||
            @Argument(force = false, name = "date") Date queryTime,
 | 
			
		||||
            @Argument(force = false, name = "force") boolean force,
 | 
			
		||||
            @Argument(force = false, name = "mode", defaultValue = "DAILY") String contentMode,
 | 
			
		||||
            @Argument(force = false, name = "type", defaultValue = "ILLUST") String contentType
 | 
			
		||||
            @Argument(force = false, name = "type", defaultValue = "ALL") String contentType
 | 
			
		||||
    ) {
 | 
			
		||||
        Date queryDate = queryTime;
 | 
			
		||||
        if (queryDate == null) {
 | 
			
		||||
@ -366,8 +366,17 @@ public class BotCommandProcess {
 | 
			
		||||
                        PixivURL.getPixivRefererLink(illustId)
 | 
			
		||||
                );
 | 
			
		||||
 | 
			
		||||
                String imageMsg = CacheStoreCentral.getCentral()
 | 
			
		||||
                        .getImageById(fromGroup, illustId, PixivDownload.PageQuality.REGULAR, 1);
 | 
			
		||||
                String imageMsg;
 | 
			
		||||
                try {
 | 
			
		||||
                    imageMsg = CacheStoreCentral.getCentral()
 | 
			
		||||
                            .getImageById(fromGroup, illustId, PixivDownload.PageQuality.REGULAR, 1);
 | 
			
		||||
                } catch (NoSuchElementException e) {
 | 
			
		||||
                    if(e.getMessage().startsWith("No work found: ")) {
 | 
			
		||||
                        log.warn("作品 {} 不存在, 跳过该作品...", illustId);
 | 
			
		||||
                        continue;
 | 
			
		||||
                    }
 | 
			
		||||
                    throw e;
 | 
			
		||||
                }
 | 
			
		||||
                if (isNoSafe(illustId, SettingProperties.getProperties(fromGroup), false)) {
 | 
			
		||||
                    log.warn("作品Id {} 为R-18作品, 跳过.", illustId);
 | 
			
		||||
                    continue;
 | 
			
		||||
 | 
			
		||||
@ -403,7 +403,8 @@ public final class CacheStoreCentral {
 | 
			
		||||
        }
 | 
			
		||||
        if (contentOption != null) {
 | 
			
		||||
            try {
 | 
			
		||||
                searchBuilder.setSearchContentOption(PixivSearchBuilder.SearchContentOption.valueOf(contentOption));
 | 
			
		||||
                searchBuilder.setSearchContentOption(
 | 
			
		||||
                        PixivSearchBuilder.SearchContentOption.valueOf(contentOption.trim().toUpperCase()));
 | 
			
		||||
            } catch (IllegalArgumentException e) {
 | 
			
		||||
                log.warn("不支持的SearchContentOption: {}", contentOption);
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user