Skip to content

Commit cc4587c

Browse files
committed
test
1 parent ded7aef commit cc4587c

File tree

2 files changed

+9
-40
lines changed

2 files changed

+9
-40
lines changed

.github/workflows/update.yaml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ permissions:
1212
contents: write
1313
issues: write
1414

15+
env:
16+
BIN_PATH: target/release/my_auto_papers.exe
17+
1518
jobs:
1619
update_daily_papers:
1720
runs-on: windows-latest
@@ -59,14 +62,18 @@ jobs:
5962
6063
- name: 检查缓存的可执行文件
6164
id: check-bin
62-
run: ./.github/scripts/check-bin.sh
65+
shell: bash
66+
run: |
67+
if [ ! -f "${{ env.BIN_PATH }}" ]; then
68+
echo "exists_bin=false" >> $GITHUB_OUTPUT
69+
fi
6370
6471
- name: 若无缓存,则构建Release版本
6572
if: steps.check-bin.outputs.exists_bin != 'true'
6673
run: cargo build --release
6774

6875
- name: 运行每日更新
69-
run: just run "${{ steps.check-bin.outputs.bin_path }}"
76+
run: just run "${{ env.BIN_PATH }}"
7077

7178
- name: 提交更改
7279
uses: stefanzweifel/git-auto-commit-action@v5

src/types.rs

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
use serde::{Deserialize, Serialize};
2-
use std::collections::HashMap;
32

43
#[derive(Debug, Clone, Serialize, Deserialize)]
54
pub struct Paper {
@@ -12,43 +11,6 @@ pub struct Paper {
1211
}
1312

1413
impl Paper {
15-
pub fn to_display_map(&self, columns: &[String]) -> HashMap<String, String> {
16-
let mut map = HashMap::new();
17-
// Always include Link even if not in columns
18-
map.insert("Link".to_string(), self.link.clone());
19-
20-
for column in columns {
21-
match column.as_str() {
22-
"Title" => map.insert(column.clone(), self.title.clone()),
23-
"Authors" => map.insert(
24-
column.clone(),
25-
if !self.authors.is_empty() {
26-
format!("{} 等", self.authors[0])
27-
} else {
28-
String::new()
29-
},
30-
),
31-
"Abstract" => map.insert(column.clone(), self.abstract_text.clone()),
32-
"Date" => {
33-
let date = self.date.split('T').next().unwrap_or("").to_string();
34-
map.insert(column.clone(), date)
35-
}
36-
_ => None,
37-
};
38-
}
39-
map
40-
}
41-
42-
pub fn get_chinese_column_name(name: &str) -> &str {
43-
match name {
44-
"Title" => "标题",
45-
"Authors" => "作者",
46-
"Abstract" => "摘要",
47-
"Date" => "日期",
48-
_ => name,
49-
}
50-
}
51-
5214
// 新增方法:生成 README 表格行
5315
pub fn to_readme_markdown(&self, index: usize) -> String {
5416
let title_link = format!("**[{}]({})**", self.title, self.link);

0 commit comments

Comments
 (0)