Skip to content

Commit 1c964c7

Browse files
paul0728claude
andcommitted
Clean up web detector, fix filename case, and improve SEO
- Fix case of tracked file exe_ver/timeline_detector.py (was Timeline_detector.py in the index; broke on case-sensitive checkouts) - web_ver/detector.py: correct bytes type hints, drop the dead str(content) assignment and the commented-out folder-detection block, narrow bare except - web_ver/index.html: set <title> to "KK Timeline Detector" and add description / keywords / OpenGraph meta tags for GitHub Pages SEO - Point README release and live-demo links to the GameProgram7777 account Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent a643385 commit 1c964c7

4 files changed

Lines changed: 14 additions & 20 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ A tool for detecting whether scene data in Koikatsu (or Koikatsu Sunshine) conta
77
### Desktop Version (exe_ver)
88
A standalone Python application built with tkinter, providing a desktop interface for timeline detection.
99

10-
Download the latest release [here](https://github.com/GameProgram777/KKTimelineDetector/releases)
10+
Download the latest release [here](https://github.com/GameProgram7777/KKTimelineDetector/releases)
1111

1212

1313
### Web Version (web_ver)
1414
A web-based version built with PyScript, providing the same functionality through a browser interface.
1515

1616
#### Live Demo
17-
Access the web version here: https://GameProgram777.github.io/KKTimelineDetector/web_ver/
17+
Access the web version here: https://GameProgram7777.github.io/KKTimelineDetector/web_ver/
1818

1919
## Features
2020
- Detects presence of timeline in scene data files

web_ver/detector.py

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,18 @@ class TimelineDetector:
66
def __init__(self):
77
self.file_content = None
88

9-
def is_scene_data(self, content_str: str) -> bool:
9+
def is_scene_data(self, content: bytes) -> bool:
1010
"""檢查是否為scene data"""
1111
try:
12-
return b"KStudio" in content_str
13-
except:
12+
return b"KStudio" in content
13+
except Exception:
1414
return False
15-
16-
def check_timeline(self, content) -> tuple[str, str, float]:
15+
16+
def check_timeline(self, content: bytes) -> tuple[str, str, float]:
1717
"""
1818
檢查timeline類型並返回timeline狀態和duration
1919
"""
2020
try:
21-
content_str = str(content)
2221
if b"timeline" in content: # 先檢查是否有timeline
2322
# 檢查是否為static (沒有Timeline就是static)
2423
if b"Timeline" not in content:
@@ -76,17 +75,7 @@ def process_file(event):
7675
if not first_file.type:
7776
window.alert("Please do not upload folders. upload only one file at a time.")
7877
return
79-
80-
# if not hasattr(first_file, 'type') or not first_file.type: # 沒有 type 或 type 為空
81-
# if hasattr(first_file, 'webkitRelativePath') and first_file.webkitRelativePath:
82-
# # 通過 webkitRelativePath 判斷是否為資料夾
83-
# if '/' in first_file.webkitRelativePath:
84-
# window.alert("Folder detected. Please upload individual files.")
85-
# return
86-
# else:
87-
# window.alert("File type or path indicates a folder. Please do not upload folders.")
88-
# return
89-
78+
9079
# 1.2 檢查檔案數量
9180
if files.length > 1:
9281
window.alert("Please upload only one file at a time.")

web_ver/index.html

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,12 @@
33
<head>
44
<meta charset="UTF-8">
55
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6-
<title>Timeline Detector</title>
6+
<title>KK Timeline Detector</title>
7+
<meta name="description" content="Detect whether Koikatsu Studio scene cards (PNG) contain Timeline data and classify them as static, GIF, or movie — runs entirely in your browser.">
8+
<meta name="keywords" content="Koikatsu, KKStudio, CharaStudio, Timeline, scene data, PNG, detector">
9+
<meta property="og:title" content="KK Timeline Detector">
10+
<meta property="og:description" content="Detect Timeline data in Koikatsu Studio scene cards (static / GIF / movie), right in your browser.">
11+
<meta property="og:type" content="website">
712
<link rel="stylesheet" href="https://pyscript.net/latest/pyscript.css" />
813
<script defer src="https://pyscript.net/latest/pyscript.js"></script>
914
<link rel="stylesheet" href="style.css">

0 commit comments

Comments
 (0)