nanozuki / dantalian

A nfo file generator for your anime. Source from Bangumi.
GNU General Public License v3.0
86 stars 7 forks source link

[RFC]Search anime and use search result generate a config #33

Closed laxect closed 3 years ago

laxect commented 3 years ago

This PR provides a way to search through bgm api and use the response to construct a dantalian config file.

The new command works like this example.

❯ dantalian gen-config world --path examples
   0 ヘタリア World★Stars / 黑塔利亚 World★Stars
     Subject ID: 317615
     Air Date: 2021-04-01
     URL: http://bgm.tv/subject/317615
   1 K SEVEN STORIES Episode 4「Lost Small World ~檻の向こうに~」 / K SEVEN STORIES Episode4「Lost Small World ∼牢笼的彼端∼」
     Subject ID: 251987
     Air Date: 2018-10-06
     URL: http://bgm.tv/subject/251987
   2 ヘタリア The World Twinkle サプライズ・ハロウィーン! / 黑塔利亚 The World Twinkle 万圣节特别篇
     Subject ID: 167180
     Air Date: 2016-02-24
     URL: http://bgm.tv/subject/167180
   3 劇場版 Free!-Road to the World-夢 / 剧场版 Free!-Road to the World-梦
     Subject ID: 271662
     Air Date: 2019-07-05
     URL: http://bgm.tv/subject/271662
   4 ワールドフールニュース PARTII / World Fool News Part 2
     Subject ID: 205845
     Air Date: 2017-04-02
     URL: http://bgm.tv/subject/205845
   5 Beauty and the Beast: Belle's Magical World / 美女与野兽之幸福生活
     Subject ID: 112506
     Air Date: 1998-02-17
     URL: http://bgm.tv/subject/112506
   6 Descendants: Wicked World (Season 1) / 后裔:极恶世界 第一季
     Subject ID: 199387
     Air Date: 2015-09-18
     URL: http://bgm.tv/subject/199387
   7 ANOTHER WORLD /
     Subject ID: 289310
     Air Date: 2019-09-13
     URL: http://bgm.tv/subject/289310
   8 HELLO WORLD / 你好 世界
     Subject ID: 269090
     Air Date: 2019-09-20
     URL: http://bgm.tv/subject/269090
   9 メジャー ワールドシリーズ編 / 棒球大联盟OVA World Series篇
     Subject ID: 30141
     Air Date: 2011-12-14
     URL: http://bgm.tv/subject/30141

  choose the one is right:
8

In this example, dantalian will generate dantalian.toml at examples directory.

exoticknight commented 3 years ago

might dantalian gen-config --keyword world --path examples be better?

laxect commented 3 years ago

might dantalian gen-config --keyword world --path examples be better?

Because of Bgm search subcommand works like dantalian bgm search hello world, I think gen-config should have the same interface.

nanozuki commented 3 years ago

What is the "gen-config", just generate a config file?

laxect commented 3 years ago

What is the "gen-config", just generate a config file?

Yes.

nanozuki commented 3 years ago

What is the "gen-config", just generate a config file?

Yes.

If a user uses the correct filename pattern, there is no need to generate config manually. The config file will be generated automatically.

laxect commented 3 years ago

What is the "gen-config", just generate a config file?

Yes.

If a user uses the correct filename pattern, there is no need to generate config manually. The config file will be generated automatically.

And this command is use for use have filename/dirname not just as same as bgm.tv.

nanozuki commented 3 years ago

And this command is use for use have filename/dirname not just as same as bgm.tv.

If the filename/dirname is not use our pattern, the config can't be auto-generated. The user must specify the regex.

laxect commented 3 years ago

And this command is use for use have filename/dirname not just as same as bgm.tv.

If the filename/dirname is not use our pattern, the config can't be auto-generated. The user must specify the regex.

This PR uses the default regex function now. I have thought of ways to generate a regex interactively but I think that can be done in future work.

nanozuki commented 3 years ago

And this command is use for use have filename/dirname not just as same as bgm.tv.

If the filename/dirname is not use our pattern, the config can't be auto-generated. The user must specify the regex.

This PR uses the default regex function now. I have thought of ways to generate a regex interactively but I think that can be done in future work.

But default regex can't use for files not renamed in our specified way.

nanozuki commented 3 years ago

Anyway, Providing an interactive method to generate files is an awesome idea.