Skip to content

Commit bdce080

Browse files
committed
release: v0.18.1
1 parent a2cfa4c commit bdce080

File tree

6 files changed

+55
-21
lines changed

6 files changed

+55
-21
lines changed

CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [0.18.1] - 2026-03-14
11+
12+
### Fixed
13+
14+
- Plugin download counts now accumulate across all versions instead of only counting the current release
15+
1016
## [0.18.0] - 2026-03-14
1117

1218
### Added
@@ -838,7 +844,8 @@ TablePro is a native macOS database client built with SwiftUI and AppKit, design
838844
- Custom SQL query templates
839845
- Performance optimized for large datasets
840846

841-
[Unreleased]: https://github.com/datlechin/tablepro/compare/v0.18.0...HEAD
847+
[Unreleased]: https://github.com/datlechin/tablepro/compare/v0.18.1...HEAD
848+
[0.18.1]: https://github.com/datlechin/tablepro/compare/v0.18.0...v0.18.1
842849
[0.18.0]: https://github.com/datlechin/tablepro/compare/v0.17.0...v0.18.0
843850
[0.17.0]: https://github.com/datlechin/tablepro/compare/v0.16.1...v0.17.0
844851
[0.16.1]: https://github.com/datlechin/tablepro/compare/v0.16.0...v0.16.1

TablePro.xcodeproj/project.pbxproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1666,7 +1666,7 @@
16661666
CODE_SIGN_IDENTITY = "Apple Development";
16671667
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "-";
16681668
CODE_SIGN_STYLE = Automatic;
1669-
CURRENT_PROJECT_VERSION = 32;
1669+
CURRENT_PROJECT_VERSION = 33;
16701670
DEAD_CODE_STRIPPING = YES;
16711671
DEVELOPMENT_TEAM = "";
16721672
ENABLE_APP_SANDBOX = NO;
@@ -1691,7 +1691,7 @@
16911691
LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks";
16921692
"LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "@executable_path/../Frameworks";
16931693
MACOSX_DEPLOYMENT_TARGET = 14.0;
1694-
MARKETING_VERSION = 0.18.0;
1694+
MARKETING_VERSION = 0.18.1;
16951695
OTHER_LDFLAGS = (
16961696
"-Wl,-w",
16971697
"-force_load",
@@ -1738,7 +1738,7 @@
17381738
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "-";
17391739
CODE_SIGN_STYLE = Automatic;
17401740
COPY_PHASE_STRIP = YES;
1741-
CURRENT_PROJECT_VERSION = 32;
1741+
CURRENT_PROJECT_VERSION = 33;
17421742
DEAD_CODE_STRIPPING = YES;
17431743
DEPLOYMENT_POSTPROCESSING = YES;
17441744
DEVELOPMENT_TEAM = D7HJ5TFYCU;
@@ -1764,7 +1764,7 @@
17641764
LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks";
17651765
"LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "@executable_path/../Frameworks";
17661766
MACOSX_DEPLOYMENT_TARGET = 14.0;
1767-
MARKETING_VERSION = 0.18.0;
1767+
MARKETING_VERSION = 0.18.1;
17681768
OTHER_LDFLAGS = (
17691769
"-Wl,-w",
17701770
"-force_load",

TablePro/Core/Plugins/Registry/DownloadCountService.swift

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,14 @@ final class DownloadCountService {
4343
do {
4444
let releases = try await fetchReleases()
4545
let pluginReleases = releases.filter { $0.tagName.hasPrefix("plugin-") }
46-
let urlToPluginId = buildURLMap(from: manifest)
46+
let tagPrefixToPluginId = buildTagPrefixMap(from: manifest)
4747

4848
var totals: [String: Int] = [:]
4949
for release in pluginReleases {
50-
for asset in release.assets {
51-
if let pluginId = urlToPluginId[asset.browserDownloadUrl] {
52-
totals[pluginId, default: 0] += asset.downloadCount
53-
}
54-
}
50+
let tagPrefix = extractTagPrefix(from: release.tagName)
51+
guard let pluginId = tagPrefixToPluginId[tagPrefix] else { continue }
52+
let releaseTotal = release.assets.reduce(0) { $0 + $1.downloadCount }
53+
totals[pluginId, default: 0] += releaseTotal
5554
}
5655

5756
counts = totals
@@ -80,22 +79,32 @@ final class DownloadCountService {
8079
return try decoder.decode([GitHubRelease].self, from: data)
8180
}
8281

83-
// MARK: - URL Mapping
82+
// MARK: - Tag Prefix Mapping
8483

85-
private func buildURLMap(from manifest: RegistryManifest) -> [String: String] {
84+
private func buildTagPrefixMap(from manifest: RegistryManifest) -> [String: String] {
8685
var map: [String: String] = [:]
8786
for plugin in manifest.plugins {
88-
if let binaries = plugin.binaries {
89-
for binary in binaries {
90-
map[binary.downloadURL] = plugin.id
91-
}
92-
}
93-
if let url = plugin.downloadURL {
94-
map[url] = plugin.id
95-
}
87+
let url = plugin.binaries?.first?.downloadURL ?? plugin.downloadURL
88+
guard let url else { continue }
89+
guard let tagComponent = extractTagComponent(from: url) else { continue }
90+
let prefix = extractTagPrefix(from: tagComponent)
91+
map[prefix] = plugin.id
9692
}
9793
return map
9894
}
95+
96+
private func extractTagComponent(from downloadURL: String) -> String? {
97+
guard let url = URL(string: downloadURL) else { return nil }
98+
let components = url.pathComponents
99+
guard let downloadIndex = components.firstIndex(of: "download"),
100+
downloadIndex + 1 < components.count else { return nil }
101+
return components[downloadIndex + 1]
102+
}
103+
104+
private func extractTagPrefix(from tag: String) -> String {
105+
guard let range = tag.range(of: #"-v\d"#, options: .regularExpression) else { return tag }
106+
return String(tag[tag.startIndex..<range.lowerBound])
107+
}
99108
}
100109

101110
// MARK: - GitHub API Models

docs/changelog.mdx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ description: "Product updates and announcements for TablePro"
44
rss: true
55
---
66

7+
<Update label="March 14, 2026" description="v0.18.1">
8+
### Bug Fixes
9+
10+
- Fixed plugin download counts resetting to zero when a new plugin version is released
11+
</Update>
12+
713
<Update label="March 14, 2026" description="v0.18.0">
814
### New Features
915

docs/vi/changelog.mdx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ description: "Cập nhật sản phẩm và thông báo cho TablePro"
44
rss: true
55
---
66

7+
<Update label="14 tháng 3, 2026" description="v0.18.1">
8+
### Sửa lỗi
9+
10+
- Sửa lỗi số lượt tải plugin bị đặt lại về 0 khi phát hành phiên bản plugin mới
11+
</Update>
12+
713
<Update label="14 tháng 3, 2026" description="v0.18.0">
814
### Tính năng mới
915

docs/zh/changelog.mdx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ description: "TablePro 产品更新与公告"
44
rss: true
55
---
66

7+
<Update label="2026 年 3 月 14 日" description="v0.18.1">
8+
### 错误修复
9+
10+
- 修复发布新插件版本时插件下载计数重置为零的问题
11+
</Update>
12+
713
<Update label="2026 年 3 月 14 日" description="v0.18.0">
814
### 新功能
915

0 commit comments

Comments
 (0)