Skip to content

Commit 2f78ad4

Browse files
soso
authored andcommitted
Release v0.1.7
1 parent 89f8c46 commit 2f78ad4

4 files changed

Lines changed: 36 additions & 17 deletions

File tree

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "emby302gateway-rs"
3-
version = "0.1.6"
3+
version = "0.1.7"
44
edition = "2024"
55
license = "MIT"
66

docs/changelog.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,29 @@
11
# 版本更新日志
22

3+
## v0.1.7
4+
5+
发布时间:2026-05-29
6+
7+
### 新增
8+
9+
- 客户端 UA 自动记录支持通用 `xx/*` 归并规则。
10+
11+
### 优化
12+
13+
- 自动记录的 `Filmly/2.5.13-340``Filmly/2.9.21-395` 等 UA 统一显示为 `Filmly`
14+
- 自动记录中带斜杠后缀的客户端统一按斜杠前名称归并,减少同客户端多版本重复记录。
15+
16+
### 修复
17+
18+
- 修复 `Filmly` 等带短横线版本后缀的 UA 未被合并、仍按版本单独显示的问题。
19+
20+
### 验证
21+
22+
- `cargo fmt --check`
23+
- `cargo check`
24+
- `cargo test client_control::tests`
25+
- `cd frontend && npx vue-tsc -b --noEmit`
26+
327
## v0.1.6
428

529
发布时间:2026-05-28

src/client_control.rs

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1456,27 +1456,14 @@ fn normalize_auto_user_agent_rule(user_agent: &str) -> String {
14561456
if value.is_empty() {
14571457
return String::new();
14581458
}
1459-
if let Some((name, version)) = value.as_str().rsplit_once('/')
1460-
&& is_version_like(version)
1459+
if let Some((name, _)) = value.as_str().split_once('/')
14611460
&& !name.trim().is_empty()
14621461
{
14631462
return name.trim().to_string();
14641463
}
14651464
value
14661465
}
14671466

1468-
fn is_version_like(value: &str) -> bool {
1469-
let value = value
1470-
.trim()
1471-
.split_once(' ')
1472-
.map_or(value.trim(), |(version, _)| version);
1473-
!value.is_empty()
1474-
&& value.chars().next().is_some_and(|ch| ch.is_ascii_digit())
1475-
&& value
1476-
.split('.')
1477-
.all(|part| !part.is_empty() && part.chars().all(|ch| ch.is_ascii_alphanumeric()))
1478-
}
1479-
14801467
fn normalize_client_rule_records(config: &mut ClientControlConfig) -> bool {
14811468
let mut changed = false;
14821469
let mut normalized = Vec::<ClientRuleRecord>::new();
@@ -1605,10 +1592,18 @@ mod tests {
16051592
normalize_auto_user_agent_rule("Emby for Apple TV/1.9.8 (2)"),
16061593
"Emby for Apple TV"
16071594
);
1595+
assert_eq!(
1596+
normalize_auto_user_agent_rule("Filmly/2.5.13-340"),
1597+
"Filmly"
1598+
);
1599+
assert_eq!(
1600+
normalize_auto_user_agent_rule("Filmly/2.9.21-395"),
1601+
"Filmly"
1602+
);
16081603
assert_eq!(normalize_auto_user_agent_rule("Mozilla/5.0"), "Mozilla");
16091604
assert_eq!(
16101605
normalize_auto_user_agent_rule("CustomClient/beta"),
1611-
"CustomClient/beta"
1606+
"CustomClient"
16121607
);
16131608
}
16141609

0 commit comments

Comments
 (0)