Optimize log
This commit is contained in:
parent
277ec77d15
commit
771e14f2ad
|
@ -226,13 +226,22 @@ namespace Jellyfin.Plugin.MetaShark.Api
|
|||
list.Add(movie);
|
||||
}
|
||||
|
||||
if (list.Count <= 0)
|
||||
if (list.Count > 0)
|
||||
{
|
||||
this._logger.LogWarning("douban搜索不到内容,这消息大量出现时,可能触发了爬虫风控。。。keyword: {0}", keyword);
|
||||
_memoryCache.Set<List<DoubanSubject>>(cacheKey, list, expiredOption);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (body.Contains("sec.douban.com"))
|
||||
{
|
||||
this._logger.LogWarning("douban触发风控,可能ip被封,请到插件配置中打开防封禁功能。。。keyword: {0}", keyword);
|
||||
}
|
||||
else
|
||||
{
|
||||
this._logger.LogWarning("douban搜索不到内容,这消息大量出现时,可能触发了爬虫风控。。。keyword: {0}", keyword);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
_memoryCache.Set<List<DoubanSubject>>(cacheKey, list, expiredOption);
|
||||
return list;
|
||||
}
|
||||
|
||||
|
|
|
@ -505,7 +505,7 @@ namespace Jellyfin.Plugin.MetaShark.Providers
|
|||
// 当movie放在文件夹中并只有一部影片时, info.name是根据文件夹名解析的,但info.Path是影片的路径名
|
||||
// 当movie放在文件夹中并有多部影片时,info.Name和info.Path都是具体的影片
|
||||
var directoryName = Path.GetFileName(Path.GetDirectoryName(info.Path));
|
||||
if (directoryName != null && directoryName.Contains(info.Name))
|
||||
if (!string.IsNullOrEmpty(directoryName) && directoryName.Contains(info.Name))
|
||||
{
|
||||
return directoryName;
|
||||
}
|
||||
|
@ -513,7 +513,7 @@ namespace Jellyfin.Plugin.MetaShark.Providers
|
|||
case EpisodeInfo:
|
||||
return Path.GetFileNameWithoutExtension(info.Path) ?? info.Name;
|
||||
default:
|
||||
// series和season文件名没扩展名
|
||||
// series和season的info.Path是文件夹路径
|
||||
return Path.GetFileName(info.Path) ?? info.Name;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue