File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -24,6 +24,9 @@ Web: # Web 页面修改相关设置
2424 <script src="/MediaWarp/custom/emby-front-end-mod/fanart-show.js"></script>
2525 <script src="/MediaWarp/custom/emby-front-end-mod/playbackRate.js"></script>
2626
27+ Robots: | # 自定义 robots.txt,若为空表示不修改
28+ User-agent: *
29+ Disallow: /
2730 Crx: True # crx 美化(Emby:https://github.com/Nolovenodie/emby-crx;Jellyfin:https://github.com/newday-life/jellyfin-crx)
2831 ActorPlus: True # 过滤没有头像的演员和制作人员
2932 FanartShow: False # 显示同人图(fanart 图)
Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ type WebSetting struct {
3737 Custom bool // 启用用户自定义静态资源
3838 Index bool // 是否从 custom 目录读取 index.html 文件作为首页
3939 Head string // 添加到 index.html 的 HEAD 中
40+ Robots string // 自定义 robots.txt,若为空表示不修改
4041 ExternalPlayerUrl bool // 是否开启外置播放器
4142 Crx bool // crx 美化
4243 ActorPlus bool // 过滤没有头像的演员和制作人员
Original file line number Diff line number Diff line change @@ -38,6 +38,14 @@ func InitRouter() *gin.Engine {
3838 if config .Web .Custom { // 用户自定义静态资源目录
3939 mediawarpRouter .Static ("/custom" , config .CostomDir ())
4040 }
41+ if config .Web .Robots != "" { // 自定义 robots.txt
42+ mediawarpRouter .GET (
43+ "/robots.txt" ,
44+ func (ctx * gin.Context ) {
45+ ctx .String (http .StatusOK , config .Web .Robots )
46+ },
47+ )
48+ }
4149 }
4250 }
4351
You can’t perform that action at this time.
0 commit comments