diff --git a/.gitignore b/.gitignore
index afa6e8e..e899205 100644
--- a/.gitignore
+++ b/.gitignore
@@ -9,3 +9,4 @@
/dist/*.tar.gz.part-*
/dist/*.tar.gz.parts.sha256
/dist/*-install.sh
+/.release-credentials
diff --git a/Cargo.lock b/Cargo.lock
index ab112d7..44ba40a 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -182,7 +182,7 @@ checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b"
[[package]]
name = "comicviewer"
-version = "0.2.10"
+version = "0.2.20"
dependencies = [
"anyhow",
"chrono",
diff --git a/Cargo.toml b/Cargo.toml
index 9c16b80..3b72bf0 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "comicviewer"
-version = "0.2.10"
+version = "0.2.20"
edition = "2024"
description = "A comic archive viewer for local and remote locations"
license = "GPL-3.0-or-later"
@@ -8,7 +8,7 @@ license = "GPL-3.0-or-later"
[dependencies]
anyhow = "1.0"
chrono = { version = "0.4", default-features = false, features = ["clock"] }
-gtk = { package = "gtk4", version = "0.10", features = ["v4_10"] }
+gtk = { package = "gtk4", version = "0.10", features = ["v4_12"] }
image = { version = "0.25", default-features = false, features = ["avif-native", "bmp", "gif", "jpeg", "png", "webp"] }
filetime = "0.2"
flate2 = "1.0"
diff --git a/data/io.github.comicviewer.Comicviewer.metainfo.xml b/data/io.github.comicviewer.Comicviewer.metainfo.xml
index 72ca04c..1949cfa 100644
--- a/data/io.github.comicviewer.Comicviewer.metainfo.xml
+++ b/data/io.github.comicviewer.Comicviewer.metainfo.xml
@@ -26,6 +26,16 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/INSTALL.ko.md b/docs/INSTALL.ko.md
index eaf3a2b..4c2b483 100644
--- a/docs/INSTALL.ko.md
+++ b/docs/INSTALL.ko.md
@@ -14,7 +14,7 @@ sudo pacman -S fuse2 gtk4 dav1d gvfs gvfs-smb gstreamer curl \
```
- `fuse2`: AppImage 마운트 및 실행
-- `gtk4`, `dav1d`: 화면 표시와 이미지 디코딩
+- `gtk4` 4.12 이상, `dav1d`: 화면 표시와 이미지 디코딩
- `gvfs`: FTP와 SFTP 접근
- `gvfs-smb`: SMB 공유 접근
- `gstreamer`, `gst-plugins-*`, `gst-libav`: MP4 등 동영상 재생
@@ -84,6 +84,8 @@ Comicviewer는 XDG 표준 경로를 사용합니다.
- 메인 창의 `캐시 비우기` 버튼으로 현재 열려 있지 않은 ZIP 캐시를 직접 삭제할 수 있습니다.
- 캐시 한도는 설정 파일의 `cache_quota_gb`로 변경하며, 0은 영구 캐시를 사용하지 않는 값입니다.
- 메인 창 검색은 현재 표시 중인 폴더의 파일명을 필터링하며, 입력을 지우면 전체 목록을 복원합니다.
+- 위치 목록의 `최근 열어본 파일`은 성공적으로 연 ZIP·이미지·동영상을 최신순으로 최대 100개 보관합니다.
+- 최근 파일 기록에는 원격 위치 재접속 정보가 함께 저장되며 `최근 기록 비우기`로 전체 기록만 삭제할 수 있습니다.
## 뷰어 조작
@@ -91,10 +93,12 @@ Comicviewer는 XDG 표준 경로를 사용합니다.
- `Home`과 `End`: 폴더의 첫 번째/마지막 파일 열기
- 동영상에서 `←`와 `→`: 5초 뒤/앞으로 이동
- 동영상에서 `↑`와 `↓`: 음량을 5%씩 조절
+- 이미지에서 `1`, `2`, `3`, `4`: 폭 맞춤, 높이 맞춤, 2페이지, 100%로 전환 (`3`은 ZIP 뷰어에서 사용)
+- 창보다 크게 표시된 이미지에서 `←`, `→`, `↑`, `↓`: 해당 방향으로 최대 100px 이동
- `L`: 우측 파일 목록 표시 또는 숨기기
- 파일 목록 상단 검색: 현재 재생 목록을 임시로 필터링하며, 입력을 지우면 전체 목록 복원
- About 창의 `업데이트`: Cafe24에서 최신 번들을 내려받아 검증 후 사용자 영역에 설치
-- 이미지에서 `+`와 `-`: 현재 화면의 이미지를 임시로 10%씩 확대 또는 축소
+- 이미지에서 `+`/`=`와 `-`: 현재 화면의 이미지를 임시로 10%씩 확대 또는 축소
- 이미지에서 `Ctrl` + 마우스 휠: 현재 화면의 이미지를 임시로 10%씩 확대 또는 축소
- 2페이지의 `좌→우`/`우→좌` 방향은 마지막 선택을 저장해 다음 뷰어에서 복원
- 전체 화면에서 마우스 클릭: 숨겨진 컨트롤을 5초 동안 표시
diff --git a/docs/RELEASING.ko.md b/docs/RELEASING.ko.md
index 4a16848..b124f8f 100644
--- a/docs/RELEASING.ko.md
+++ b/docs/RELEASING.ko.md
@@ -55,7 +55,7 @@ AppImage 빌드가 끝나면 다음 스크립트로 체크섬과 통합 `tar.gz`
스크립트는 `Cargo.toml`에서 버전을 읽고 다음 파일을 생성합니다.
-- `dist/Comicviewer-0.2.10-x86_64.AppImage.sha256`
+- `dist/Comicviewer-0.2.20-x86_64.AppImage.sha256`
- `dist/Comicviewer-latest-x86_64.tar.gz`
- `dist/Comicviewer-latest-x86_64.tar.gz.sha256`
@@ -78,10 +78,10 @@ sha256sum -c Comicviewer-latest-x86_64.tar.gz.sha256
```sh
git add Cargo.toml Cargo.lock data packaging README.md docs
-git commit -m "Release v0.2.10"
-git tag -a v0.2.10 -m "Comicviewer v0.2.10"
+git commit -m "Release v0.2.20"
+git tag -a v0.2.20 -m "Comicviewer v0.2.20"
git push origin main
-git push origin v0.2.10
+git push origin v0.2.20
```
이미 원격에 공개한 태그는 이동하거나 덮어쓰지 않습니다. 수정이 필요하면 새
diff --git a/src/config.rs b/src/config.rs
index 90c3473..905b382 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -15,6 +15,7 @@ pub struct AppConfig {
pub two_page_right_to_left: bool,
pub locations: Vec,
pub favorites: Vec,
+ pub recent_files: Vec,
}
impl Default for AppConfig {
@@ -27,6 +28,7 @@ impl Default for AppConfig {
two_page_right_to_left: true,
locations: Vec::new(),
favorites: Vec::new(),
+ recent_files: Vec::new(),
}
}
}
@@ -52,6 +54,13 @@ pub struct FavoriteEntry {
pub profile: LocationProfile,
}
+#[derive(Debug, Clone, Serialize, Deserialize)]
+pub struct RecentFileEntry {
+ pub name: String,
+ pub uri: String,
+ pub profile: LocationProfile,
+}
+
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "lowercase")]
pub enum LocationKind {
@@ -203,6 +212,18 @@ mod tests {
domain: String::new(),
},
}],
+ recent_files: vec![RecentFileEntry {
+ name: "최근 영상.mp4".into(),
+ uri: "sftp://example.invalid/comics/recent.mp4".into(),
+ profile: LocationProfile {
+ name: "최근 서버".into(),
+ kind: LocationKind::Sftp,
+ address: "sftp://example.invalid/comics".into(),
+ username: "recent-reader".into(),
+ password: "recent-password".into(),
+ domain: String::new(),
+ },
+ }],
};
let encoded = toml::to_string(&config).unwrap();
@@ -210,6 +231,8 @@ mod tests {
assert_eq!(decoded.locations[0].password, "plain-password");
assert_eq!(decoded.favorites[0].profile.username, "favorite-reader");
assert_eq!(decoded.favorites[0].profile.password, "favorite-password");
+ assert_eq!(decoded.recent_files[0].profile.username, "recent-reader");
+ assert_eq!(decoded.recent_files[0].profile.password, "recent-password");
}
#[test]
@@ -220,6 +243,7 @@ mod tests {
assert_eq!(decoded.viewer_mode, ViewerMode::FitWidth);
assert!(decoded.two_page_right_to_left);
assert!(decoded.favorites.is_empty());
+ assert!(decoded.recent_files.is_empty());
}
#[test]
diff --git a/src/source.rs b/src/source.rs
index fc9b2c2..bf6b8e2 100644
--- a/src/source.rs
+++ b/src/source.rs
@@ -16,6 +16,32 @@ const RECURSIVE_ATTRIBUTES: &str = "standard::display-name,standard::name,standa
const MAX_RECURSIVE_DIRECTORIES: usize = 10_000;
const MAX_RECURSIVE_ENTRIES: usize = 100_000;
+#[derive(Default)]
+struct EnumerationProgress {
+ seen: HashSet,
+ new_in_batch: usize,
+}
+
+impl EnumerationProgress {
+ fn begin_batch(&mut self) {
+ self.new_in_batch = 0;
+ }
+
+ fn record(&mut self, uri: String) -> bool {
+ let inserted = self.seen.insert(uri);
+ self.new_in_batch += usize::from(inserted);
+ inserted
+ }
+
+ fn repeated_batch(&self) -> bool {
+ self.new_in_batch == 0
+ }
+
+ fn len(&self) -> usize {
+ self.seen.len()
+ }
+}
+
#[derive(Clone, Copy, Default)]
pub struct RecursiveProgress {
pub directories: usize,
@@ -112,7 +138,7 @@ where
}
};
let mut entries = Vec::new();
- let mut scanned = 0;
+ let mut enumeration = EnumerationProgress::default();
loop {
let batch = enumerator
@@ -121,19 +147,21 @@ where
if batch.is_empty() {
break;
}
- scanned += batch.len();
- progress(scanned);
+ enumeration.begin_batch();
for info in batch {
+ let child = enumerator.child(&info);
+ let uri: String = info
+ .attribute_string("standard::target-uri")
+ .map_or_else(|| child.uri().into(), Into::into);
+ if !enumeration.record(uri.clone()) {
+ continue;
+ }
let kind = match info.file_type() {
gio::FileType::Directory => EntryKind::Directory,
gio::FileType::Mountable | gio::FileType::Shortcut => EntryKind::Directory,
gio::FileType::Regular => classify_file(Path::new(info.display_name().as_str())),
_ => continue,
};
- let child = enumerator.child(&info);
- let uri = info
- .attribute_string("standard::target-uri")
- .map_or_else(|| child.uri().into(), Into::into);
entries.push(BrowserEntry {
uri,
name: info.display_name().into(),
@@ -153,6 +181,10 @@ where
.map(Into::into),
});
}
+ if enumeration.repeated_batch() {
+ break;
+ }
+ progress(enumeration.len());
}
Ok(entries)
}
@@ -449,6 +481,26 @@ mod tests {
assert!(encoded_input.equal(&encoded));
}
+ #[test]
+ fn enumeration_allows_large_unique_directories_and_stops_repeated_batches() {
+ let mut enumeration = EnumerationProgress::default();
+ for batch_start in (0..330_001).step_by(128) {
+ enumeration.begin_batch();
+ for index in batch_start..(batch_start + 128).min(330_001) {
+ assert!(enumeration.record(format!("smb://server/share/file-{index}")));
+ }
+ assert!(!enumeration.repeated_batch());
+ }
+ assert_eq!(enumeration.len(), 330_001);
+
+ enumeration.begin_batch();
+ for index in 0..128 {
+ assert!(!enumeration.record(format!("smb://server/share/file-{index}")));
+ }
+ assert!(enumeration.repeated_batch());
+ assert_eq!(enumeration.len(), 330_001);
+ }
+
#[test]
fn recursively_lists_viewable_files_without_following_symlinks() {
let directory = tempfile::tempdir().unwrap();
diff --git a/src/viewer.rs b/src/viewer.rs
index 52ad233..eb0ee7c 100644
--- a/src/viewer.rs
+++ b/src/viewer.rs
@@ -23,9 +23,12 @@ const VIDEO_VOLUME_STEP: f64 = 0.05;
const IMAGE_ZOOM_STEP: f64 = 0.1;
const IMAGE_ZOOM_MIN: f64 = 0.1;
const IMAGE_ZOOM_MAX: f64 = 4.0;
+const IMAGE_PAN_STEP: f64 = 100.0;
const VIEWER_CONTROLLER_KEY: &str = "comicviewer-viewer-controller";
const MEDIA_VIEWER_CONTROLLER_KEY: &str = "comicviewer-media-viewer-controller";
const VIEWER_FILE_SEARCH_KEY: &str = "comicviewer-file-search";
+const VIEWER_FILE_SCROLL_KEY: &str = "comicviewer-file-scroll";
+const VIEWER_VIDEO_LOOP_KEY: &str = "comicviewer-video-loop";
const PRESERVE_SEEK_CLASS: &str = "viewer-preserve-seek";
fn clear_viewer_controller(window: >k::ApplicationWindow) {
@@ -284,11 +287,19 @@ impl ViewerWindow {
} = controls;
let direction_control = two_page_direction_control
.expect("archive viewer requires a two-page direction control");
- let title = source.display_name.clone();
+ let title_files = sibling_navigator
+ .as_ref()
+ .map(SiblingNavigator::files)
+ .unwrap_or_default();
+ let title = viewer_file_title(&source.display_name, &source.source_uri, &title_files);
let file_list_query = reuse_window
.as_ref()
.map(viewer_file_search_query)
.unwrap_or_default();
+ let file_list_scroll = reuse_window
+ .as_ref()
+ .map(viewer_file_scroll_position)
+ .unwrap_or_default();
if let Some(window) = reuse_window.as_ref() {
clear_viewer_controller(window);
}
@@ -305,7 +316,7 @@ impl ViewerWindow {
set_viewer_loading(&window, false);
window.set_title(Some(&title));
let header = gtk::HeaderBar::new();
- header.set_title_widget(Some(>k::Label::new(Some(&title))));
+ header.set_title_widget(Some(&viewer_title_label(&title)));
let favorite_button = gtk::Button::with_label(favorite_label(favorite_control.active));
let download_button = gtk::Button::with_label("파일 다운로드");
let file_list_button = gtk::ToggleButton::with_label("파일 목록");
@@ -454,8 +465,10 @@ impl ViewerWindow {
file_list_button,
file_list_panel: file_list.panel,
file_list_search: file_list.search,
+ file_list_scrolled: file_list.scrolled,
file_list: file_list.list,
file_list_files: RefCell::new(Vec::new()),
+ file_list_scroll_restore: Cell::new(Some(file_list_scroll)),
favorite_button,
favorite_toggle: favorite_control.toggle,
download_button,
@@ -625,8 +638,10 @@ struct ViewerController {
file_list_button: gtk::ToggleButton,
file_list_panel: gtk::Box,
file_list_search: gtk::SearchEntry,
+ file_list_scrolled: gtk::ScrolledWindow,
file_list: gtk::ListBox,
file_list_files: RefCell>,
+ file_list_scroll_restore: Cell