rmsitzandClaude Sonnet 5 2941910c54 Cache library filesystem scans to fix ~90s NAS page loads
There was no caching anywhere in the app, so every request re-walked
the SMB-mounted library from scratch - the dashboard alone triggered
2 duplicate full-library directory walks, 100+ individual
.offlineu_progress.json opens, and ~10-15 full per-course recursive
rglob() scans, none of it shared between requests. Measured ~90s per
dashboard load against the real mounted NAS, with a second immediate
reload taking just as long - proof nothing was being reused.

Add a minimal in-process TTL cache (5 min) and apply it at the actual
hot spots: the shared course-directory listing (get_all_course_dirs,
replacing 6 independent iter_all_courses() walks), the per-course
media-count/thumbnail summary (_course_summary, also now reused by
list_library_directory instead of a third duplicate implementation),
the per-course tree scan (get_course_tree - safe to cache since
progress is always re-applied fresh on top, never baked into the
cached structure), and the transcript-search subtitle index (the
worst offender - previously re-read and lowercased every subtitle
file in the library on every search).

Invalidates immediately on hide/show, rename, and library-path
changes; a "Refresh Library" button on Settings covers files added
directly on the NAS outside the app.

Measured after the fix, same real NAS mount: dashboard ~90s -> 1.3s
warm, Notes Hub ~1.15s warm, Library browser ~3.6s warm.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-23 14:27:24 -04:00
2026-08-20 13:47:51 -04:00
2026-08-20 13:47:51 -04:00
2026-08-20 13:47:51 -04:00
2026-08-20 13:47:51 -04:00
2026-08-20 13:47:51 -04:00
2026-08-20 13:47:51 -04:00

OfflineU: Self-Hosted Local Course Loader & Progress Tracker

OfflineU is a sleek, self-hosted web app designed to load and view your offline video, audio, text, and quiz-based training courses. Whether it's Udemy downloads, "open sourced" training archives, or personal content, OfflineU turns your course folder into a fully navigable dashboard with automatic progress tracking.


Features

  • 📁 Dynamic folder parsing: Scans and maps your course structure into a browsable tree view.
  • 🎥 Video & Audio player: Integrated media player with resume & completion tracking.
  • 📄 Text & HTML viewer: Supports .txt, .md, .html, .pdf, and more.
  • Lesson progress tracking: Auto-saves your time spent and marks lessons as completed.
  • ♻️ Continue where you left off: Resume instantly from your last-accessed lesson.
  • 💾 Local-first & private: 100% offline. No cloud, no tracking, no nonsense.
  • 🧑‍💻 Works with any course format: No metadata required, just structured folders.
  • 🧠 Ideal for hoarders, students, or offline learning setups

🗈️ Screenshots

image


🛠️ Installation

🔁 Quick Start (Local)

  1. Clone the repo:

    git clone https://github.com/WhiskeyCoder/OfflineU.git
    cd OfflineU
    
  2. Install Python dependencies:

    pip install flask
    
  3. Run the app:

    python offlineu_core.py --create-templates
    
  4. Open your browser:

    http://127.0.0.1:5000
    

📂 Folder Structure Example

MyCourse/
├── Section 1/
│   ├── 01 - Intro.mp4
│   ├── 02 - Setup Guide.pdf
│   └── 03 - Quiz.html
├── Section 2/
│   ├── 04 - Advanced Tips.mp4
│   └── resources/
│       └── extras.md
└── .offlineu_progress.json  ← created automatically

🌟 File types are detected automatically — videos, audio, quizzes, and docs.


📁 Supported File Types

Type Extensions
Videos .mp4, .mkv, .webm, .mov, .avi, etc.
Audio .mp3, .wav, .aac, etc.
Docs .txt, .md, .html, .pdf, .docx
Subtitles .srt, .vtt
Quizzes Detected if file name contains quiz, exam, test, etc.

⚙️ CLI Options

Option Description
--host Set host (default: 127.0.0.1)
--port Set port (default: 5000)
--debug Enable Flask debug mode
--create-templates Generate default HTML templates
<course_path> Load course directly at startup

🧠 Roadmap

  • Base function and testing
  • Multi-user profile support
  • Dark/light theme switcher
  • Built-in quiz interactivity
  • Import/export course metadata
  • Mobile app wrapper
  • Self hosted Docker Deployment

💬 Community

Join the development, suggest features, or ask questions via:


🛡️ License

MIT License — Use freely, modify locally, share widely.


Author

Built with ❤️ by @WhiskeyCoder Inspired by the dream of learning freely, offline, and without limits.

S
Description
My version of offlineu
Readme MIT
1.1 MiB
Languages
HTML 58.2%
Python 41.4%
JavaScript 0.2%
Dockerfile 0.2%