opened
RicterZ
username_0
数据操作的部分要不要都放在 admin 里，前台只做展示功能吧。
BGmi Frontend Design
issue
created
Trim21
username_1
比如....?
comment
created
Trim21
username_1
比如config subscribe之类的都收在admin里面?
comment
created
Trim21
username_1
![image](https://user-images.githubusercontent.com/13553903/31073977-fa62fb34-a7a0-11e7-8383-6b4c76743d92.png)
comment
created
RicterZ
username_0
对，涉及到数据操作的基本都是 admin 功能了。不过我感觉前端功能没必要那么全。

- [ ] 添加订阅
- [ ] 删除订阅

就够了吧..=A=
comment
created
RicterZ
username_0
另外 rss 和 ics calendar 的路径改为了：

+ /resource/feed.xml
+ /resource/calendar.ics
comment
created
Trim21
username_1
不过config都加上了,也没必要删掉了吧...(
`0.8.13`先改了recourse的路径,admin具体的结构我再考虑下怎么改
comment
created
RicterZ
username_0
要不罗列一下打算做和已经做的列表，我看看留哪些（
comment
created
Trim21
username_1
已有的
- config
- add
- delete

还没做的但是打算做的...
- search
- filter
comment
created
RicterZ
username_0
config 只展示吧暂时。
倒是可以做一下 mark，更改集数、状态等。
search 暂时不做，filter 可以做一下。

另外可以做一个 update。
comment
created
RicterZ
username_0
ics calendar 移动到 feed 下面是不是比较好看..
comment
created
Trim21
username_1
- bangumi
  - player
- calendar
- admin
  - subscribe
  - filter
  - view config
- resource
  - feed
  - ics calendar

这样如何(
comment
created
RicterZ
username_0
resource不必单独分页吧，admin 加一个 mark 和 update（？
comment
created
Trim21
username_1
不分页,只是默认折叠
comment
created
RicterZ
username_0
折叠感觉也不用吧，要么先做做看_(:3」∠)_
comment
created
Trim21
username_1
- bangumi -> player
- calendar
- admin
  - subscribe
    - add
    - delete
    - mark
  - filter
  - view config
  - update
- resource
  - feed
  - ics calendar
comment
created
RicterZ
username_0
OK
comment
created
Trim21
username_1
add和fetch合并吧..
反正用到的是同一份数据,cli里面还有分别敲两个命令
comment
created
Trim21
username_1
emmm
主要是add完了还要fetch比较烦,感觉应该直接就可以filter了
comment
created
Trim21
username_1
- [x] bangumi -> player
- [x] calendar
- [ ] admin
  - [ ] subscribe
    - [x] add
    - [x] delete
    - [ ] mark
    - [ ] filter
  - [x] view config
  - [ ] update
- [x] resource
  - [x] feed
  - [x] ics calendar
comment
created
Trim21
username_1
折叠的一个原因是......sidebar可能不够高(
而且feed和 ics calendar也不是什么会经常点的东西
comment
created
RicterZ
username_0
Update API:

+ GET
+ name 为空时 update 全部，暂时不做指定 name 的
+ 返回样例

```json
{
  "status": "info",
  "version": "1.4.6",
  "danmaku_api": "",
  "message": "",
  "data": [
    {
      "episode": 1,
      "bangumi": "阿松 第2期"
    },
    {
      "episode": 12,
      "bangumi": "NEW GAME!!"
    }
  ],
  "cover_url": "/bangumi/cover"
}
```
comment
created
RicterZ
username_0
data 为空时即没有啥 update 的，默认不下载，在考虑是否要默认下载？
comment
created
Trim21
username_1
用用
comment
created
Trim21
username_1
前端加一个选项，存在cookies里好了
comment
created
RicterZ
username_0
原来 POST 的是 json 格式的，我改改..
comment
created
Trim21
username_1
post都是json…
comment
created
Trim21
username_1
我看代码里是get方法…
comment
created
RicterZ
username_0
不下载（bool(download) 为 false 的时候都不下载）：
```bash
^^/G/BGmi >>> curl -i -H "BGmi-Token: 381b5a395b7afc8ddf0e91e193ab8d3b" localhost:8888/api/update --data '{"name":"", "download": []}'
```

下载
```bash
curl -i -H "BGmi-Token: 381b5a395b7afc8ddf0e91e193ab8d3b" localhost:8888/api/update --data '{"name":"", "download": true}'
```
comment
created
RicterZ
username_0
Mark API
```bash
^^/G/BGmi >>> curl -i -H "BGmi-Token: 381b5a395b7afc8ddf0e91e193ab8d3b" localhost:8888/api/mark --data '{"name": "NEW GAME!!", "episode": 1}'
HTTP/1.1 200 OK
Date: Wed, 04 Oct 2017 12:11:47 GMT
Content-Length: 177
Content-Type: text/html; charset=UTF-8
Content-Type: application/json; charset=utf-8
Server: TornadoServer/4.4.2

{
  "status": "success",
  "version": "1.4.6",
  "danmaku_api": "",
  "message": "NEW GAME!! has been mark as episode: 1",
  "data": null,
  "cover_url": "/bangumi/cover"
}
```
comment
created
Trim21
username_1
空数组还行…false不行吗（
comment
created
RicterZ
username_0
bool(download) 为 false 的时候都不下载
comment
created
Trim21
username_1
哦哦bool(download)
comment
created
Trim21
username_1
Content-type 重复了…
comment
created
RicterZ
username_0
emmmm..
comment
created
RicterZ
username_0
我看看
comment
created
Trim21
username_1
也返回一下title吧
comment
created
RicterZ
username_0
啥的 title? mark?
comment
created
Trim21
username_1
下载的那几集的title
comment
created
RicterZ
username_0
感觉没必要呀，其实我感觉返回数据都没必要，让前端知道已经 update 了就成..
comment
created
Trim21
username_1
点了一下update之后你会不想要知道到底update了什么内容吗…
comment
created
RicterZ
username_0
但是下载了什么就没必要知道了吧..
comment
created
Trim21
username_1
点了一下update之后你不会想要知道到底update了什么内容吗…
comment
created
Trim21
username_1
有吧…update本来就是修改了某些设置之后为了下载才采取的操作，还是有必要展示一下到底下载了什么东西吧…
comment
created
RicterZ
username_0
修改状态：

+ 0 标记为未更新（也就是之前有个红圈圈的标记）
+ 1 为已更新

```bash
curl -i -H "BGmi-Token: 381b5a395b7afc8ddf0e91e193ab8d3b" localhost:8888/api/status --data '{"name": "NEW GAME!!", "status": 1}'
HTTP/1.1 200 OK
Date: Wed, 04 Oct 2017 12:52:55 GMT
Content-Length: 187
Content-Type: application/json; charset=utf-8
Server: TornadoServer/4.4.2

{
  "status": "success",
  "version": "1.4.6",
  "danmaku_api": "",
  "message": "Followed<NEW GAME!!> has been marked as status 1",
  "data": null,
  "cover_url": "/bangumi/cover"
}
```
comment
created
RicterZ
username_0
update 这个得改格式了
comment
created
RicterZ
username_0
UPDATE API：

```bash
curl -i -H "BGmi-Token: 381b5a395b7afc8ddf0e91e193ab8d3b" localhost:8888/api/update --data '{"download": true}'
HTTP/1.1 200 OK
Date: Wed, 04 Oct 2017 13:01:07 GMT
Content-Length: 620
Content-Type: application/json; charset=utf-8
Server: TornadoServer/4.4.2

{
  "status": "info",
  "version": "1.4.6",
  "danmaku_api": "",
  "message": "",
  "data": {
    "downloaded": [
      {
        "episode": 12,
        "name": "NEW GAME!!",
        "subtitle_group": "55c0575824180bc3647feb1c",
        "title": "【动漫国字幕组】★07月新番[野良与皇女与流浪猫之心][12 END][720P][简体][MP4]",
        "time": 1506583491,
        "download": "magnet:?xt=urn:btih:49e9825bf918000dc5ba1c69071452b49b36874d"
      }
    ],
    "updated": [
      {
        "episode": 12,
        "bangumi": "NEW GAME!!"
      }
    ]
  },
  "cover_url": "/bangumi/cover"
}
```
comment
created
Trim21
username_1
没看懂status是用来干嘛的..........
comment
created
RicterZ
username_0
Filter API:

```bash
curl -i -H "BGmi-Token: 381b5a395b7afc8ddf0e91e193ab8d3b" localhost:8888/api/filter --data '{"name": "NEW GAME!!", "regex": "asd", "subtitle": ""}'
HTTP/1.1 200 OK
Date: Wed, 04 Oct 2017 13:15:31 GMT
Content-Length: 551
Content-Type: application/json; charset=utf-8
add filter
Server: TornadoServer/4.4.2

{
add test for filter api
  "status": "success",
  "version": "1.4.6",
  "danmaku_api": "",
  "message": "",
  "data": {
    "regex": "asd",
    "followed": [],
    "subtitle_group": [
      "DHR動研字幕組",
      "西农YUI汉化组",
      "千夏字幕組",
      "漫猫字幕组",
      "花语发布",
      "動漫國字幕組",
      "轻之国度字幕组",
      "桜都字幕组",
      "NEW_NODE",
      "动漫花园"
    ],
    "exclude": null,
    "bangumi_name": "NEW GAME!!",
    "include": null
  },
  "cover_url": "/bangumi/cover"
}
```
comment
created
Trim21
username_1
`add test for filter api`?
comment
created
RicterZ
username_0
就是更新了后有个小红点的标记呀。。
status 就是修改标记用的
comment
created
RicterZ
username_0
你这一版前端，更新了后有没有什么标记之类的东西..
comment
created
Trim21
username_1
没有(
是想要在点进了`player/bangumi/player`之后把status标记成0,然后红点消失吗

顺便一块把前端版本升到`0.9.x`吧,等我我写完了publish
comment
created
RicterZ
username_0
不不不，这个在后台用户手动标记比较好，不要自动做。
comment
created
Trim21
username_1
所以是1有红点0没有?
cli里好像没有类似的东西,不太能理解使用场景(
comment
created
RicterZ
username_0
有是 2，没有是 1。
使用场景就是 mark 掉呀，比如看过后 mark 了就不再显示红点了。
现在的做法是每两个小时 crontab update 一次，如果发现 update_time 在一天之前的话就把红点去掉。
comment
created
RicterZ
username_0
这样吧，你这个 api 可以先不做，看后期使用场景再说
comment
created
Trim21
username_1
噗,原来有这样的功能吗(
那就先不做了,先把这几个昨晚再说
comment
created
Trim21
username_1
[https://github.com/BGmi/BGmi/issues/28](https://github.com/BGmi/BGmi/issues/28)
comment
created
Trim21
username_1
add的时候顺便也fetch一下吧,不然无法filter,也没有相应的fetch的HTTP API
comment
created
Trim21
username_1
两个函数调用的都是`website.get_maximum_episode` 应该可以...
comment
created
Trim21
username_1
filter api在查询的时候data.followed==[]
comment
created
Trim21
username_1
而且filter api的query和response里面的key也统一一下吧..
comment
created
RicterZ
username_0
啥意思（
comment
created
Trim21
username_1
查询的时候番剧名是name 在data里面番剧名是bangnu_name
订阅的字幕组在args里面是subtitle 在data里面是followed

还有就是查询的时候如果不提供filter就会把原来订阅的字幕组清空
comment
created
Trim21
username_1
准确的说是不提供subtitle
comment
created
RicterZ
username_0
统一了，但是 `还有就是查询的时候如果不提供subtitle就会把原来订阅的字幕组清空`，本来就是这样的呀，只查询的话，直接 `{"name": "NEW GAME!!"}`？
comment
created
RicterZ
username_0
没有呀，我测试ok的..
comment
created
RicterZ
username_0
发个你的测试用例?
comment
created
RicterZ
username_0
```bash
^^>>> curl -H "BGmi-Token: 381b5a395b7afc8ddf0e91e193ab8d3b" localhost:8888/api/filter --data '{"name": "NEW GAME!!"}' | jq .data.followed
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   589  100   567  100    22  41755   1620 --:--:-- --:--:-- --:--:-- 43615
[
  "动漫花园"
]
^^>>> curl -H "BGmi-Token: 381b5a395b7afc8ddf0e91e193ab8d3b" localhost:8888/api/filter --data '{"name": "NEW GAME!!"}' | jq .data.followed
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   589  100   567  100    22  43401   1684 --:--:-- --:--:-- --:--:-- 47250
[
  "动漫花园"
]
```
comment
created
Trim21
username_1
![1](https://user-images.githubusercontent.com/13553903/31233002-0c2f3e3e-aa1e-11e7-9d04-fa11e9525904.png)
![2](https://user-images.githubusercontent.com/13553903/31233003-0c4a1484-aa1e-11e7-941e-ff672d08bf7b.png)
comment
created
Trim21
username_1
这是mikan的...
comment
created
RicterZ
username_0
我测试还是没问题....emm
comment
created
RicterZ
username_0
![image](https://user-images.githubusercontent.com/5282759/31233668-c4fce02c-a9b2-11e7-8734-3716380bc094.png)
comment
created
Trim21
username_1
emmmmm
pull了之后
add之后filter还有个bug
![image](https://user-images.githubusercontent.com/13553903/31234009-5ee3c670-aa20-11e7-84fb-a975d3fb53ca.png)
comment
created
RicterZ
username_0
这个修了，PR 还没 merge，在等 CI
comment
created
Trim21
username_1
噗,上面那个bug也好了
comment
created
Trim21
username_1
偷懒直接把config从sidebar里去掉了

Bug Report在About里

![image](https://user-images.githubusercontent.com/13553903/31239449-afd9bc1a-aa2f-11e7-98f4-912921138303.png)
comment
created
Trim21
username_1
感觉完美了(
comment
created
Trim21
username_1
emmmmmm
已经有了`api/cal` 为什么还要加一个`api/calendar`...
comment
closed
Trim21
username_1
issue
created
RicterZ
username_0
emm，那你去掉吧（x
comment
created
Trim21
username_1
...你这两个是不是回复反了
comment
created
RicterZ
username_0
cal 那个嘛
comment
created
Trim21
username_1
我把api/calendar删掉了

> 在 2017年10月8日，下午9:04，Ricter Zheng <notifications@github.com> 写道：
> 
> cal 那个嘛
comment
created
Trim21
username_1
是说issue和pr刚刚的两个回复。。。

> 在 2017年10月8日，下午8:29，Ricter Zheng <notifications@github.com> 写道：
> 
> emm，那你去掉吧（x
> 
>
comment
created
Trim21
username_1
噗 没事，我晕了。。。
readme更新过了
目前剩下的事是不是只有docker了（
comment