[FEATURE] - Time Tracking #57

Closed
opened 2026-02-19 16:42:50 -08:00 by naomi · 0 comments
Owner

Attestations

  • I have read and agree to the Code of Conduct
  • I have read and agree to the Community Guidelines.
  • I have confirmed that the issue I am opening is unique, and has not already been reported (whether closed or not).
  • I have reviewed the Security Policy and have determined that this is not a security vulnerability.
  • This is not a feature request or bug report that I am mis-filing to avoid the issue template.

Share your thoughts:

Add time tracking functionality to record how long was spent on each media item (reading a book, playing a game, watching a show, etc.).

Implementation Approach

Manual Time Entry

  • Add optional timeSpent field (stored in minutes or hours)
  • Allow users to manually input time when editing items
  • Support multiple time entries (session-based tracking)

Time Entry Options

  • Single Total: One field for total time spent (simplest)
  • Session-Based: Log multiple sessions with dates (more detailed)

Database Design

Option 1: Single Total Field

  • Add timeSpent (integer, minutes) to each media model
  • Simple to implement and display

Option 2: Session-Based Tracking

  • Create TimeSession table:
    • id, userId, entityType, entityId, duration, sessionDate, notes
  • Allows detailed tracking of individual sessions
  • Can calculate totals on demand

API Changes

  • Add timeSpent field to Create and Update DTOs
  • If session-based: Add endpoints for managing time sessions
    • POST /api/{type}/{id}/time - Log a time session
    • GET /api/{type}/{id}/time - Get time sessions for an item
    • PUT /api/{type}/{id}/time/{sessionId} - Update a session
    • DELETE /api/{type}/{id}/time/{sessionId} - Delete a session

Frontend Changes

Input Fields

  • Add time input to "Add New" and "Edit" forms
  • Support different time units (hours, minutes)
  • Calculate and display total time for session-based tracking

Display

  • Show time spent on item cards
  • Add time statistics to user profiles
  • Display time trends (time spent per month/year)
  • Show average time per media type

Time Entry UI

If session-based:

  • "Log Time" button on item cards
  • Modal/form with: date, duration, optional notes
  • Display session history per item
  • Edit/delete individual sessions

Statistics & Insights

  • Total time spent across all media
  • Time breakdown by media type
  • Most time spent on a single item
  • Average time per item
  • Time trends over months/years
  • Compare time spent vs items completed

Use Cases

  • Books: Track reading time, see how long books take
  • Games: Track play time (hours invested)
  • Shows: Calculate total watch time for series
  • Music: Track listening time for albums
  • Manga: Track reading sessions

UI Considerations

  • Format time display nicely (e.g., "15h 30m", "3 hours", "45 minutes")
  • Add time picker component (hours and minutes)
  • Show time statistics on profile pages
  • Optional: Add charts/graphs for time visualization

This issue was created with help from Hikari~ 🌸

### Attestations - [x] I have read and agree to the [Code of Conduct](https://docs.nhcarrigan.com/community/coc/) - [x] I have read and agree to the [Community Guidelines](https://docs.nhcarrigan.com/community/guide/). - [x] I have confirmed that the issue I am opening is unique, and has not already been reported (whether closed or not). - [x] I have reviewed the [Security Policy](https://docs.nhcarrigan.com/legal/security/) and have determined that this is not a security vulnerability. - [x] This is not a feature request or bug report that I am mis-filing to avoid the issue template. ### Share your thoughts: Add time tracking functionality to record how long was spent on each media item (reading a book, playing a game, watching a show, etc.). ## Implementation Approach ### Manual Time Entry - Add optional `timeSpent` field (stored in minutes or hours) - Allow users to manually input time when editing items - Support multiple time entries (session-based tracking) ### Time Entry Options - **Single Total**: One field for total time spent (simplest) - **Session-Based**: Log multiple sessions with dates (more detailed) ## Database Design ### Option 1: Single Total Field - Add `timeSpent` (integer, minutes) to each media model - Simple to implement and display ### Option 2: Session-Based Tracking - Create `TimeSession` table: - `id`, `userId`, `entityType`, `entityId`, `duration`, `sessionDate`, `notes` - Allows detailed tracking of individual sessions - Can calculate totals on demand ## API Changes - Add `timeSpent` field to Create and Update DTOs - If session-based: Add endpoints for managing time sessions - `POST /api/{type}/{id}/time` - Log a time session - `GET /api/{type}/{id}/time` - Get time sessions for an item - `PUT /api/{type}/{id}/time/{sessionId}` - Update a session - `DELETE /api/{type}/{id}/time/{sessionId}` - Delete a session ## Frontend Changes ### Input Fields - Add time input to "Add New" and "Edit" forms - Support different time units (hours, minutes) - Calculate and display total time for session-based tracking ### Display - Show time spent on item cards - Add time statistics to user profiles - Display time trends (time spent per month/year) - Show average time per media type ### Time Entry UI If session-based: - "Log Time" button on item cards - Modal/form with: date, duration, optional notes - Display session history per item - Edit/delete individual sessions ## Statistics & Insights - Total time spent across all media - Time breakdown by media type - Most time spent on a single item - Average time per item - Time trends over months/years - Compare time spent vs items completed ## Use Cases - **Books**: Track reading time, see how long books take - **Games**: Track play time (hours invested) - **Shows**: Calculate total watch time for series - **Music**: Track listening time for albums - **Manga**: Track reading sessions ## UI Considerations - Format time display nicely (e.g., "15h 30m", "3 hours", "45 minutes") - Add time picker component (hours and minutes) - Show time statistics on profile pages - Optional: Add charts/graphs for time visualization ✨ This issue was created with help from Hikari~ 🌸
naomi closed this issue 2026-02-20 01:51:25 -08:00
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: nhcarrigan/library#57