Skip to content

Conversation

@vNawar
Copy link
Contributor

@vNawar vNawar commented Aug 26, 2025

added buttons to switch between grid and list views

Screenshot 2025-08-27 at 00-10-53 MeTube Screenshot 2025-08-27 at 00-10-48 MeTube image image

@alexta69 alexta69 requested a review from Copilot September 5, 2025 13:02
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Adds a grid view option with thumbnail previews for the completed downloads section, allowing users to switch between the traditional list view and a new grid view with visual thumbnails.

  • Added view toggle buttons to switch between list and grid views in the completed downloads section
  • Implemented thumbnail generation endpoint using ffmpeg to create video previews
  • Enhanced UI with grid layout showing video thumbnails in card format

Reviewed Changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
ui/src/app/downloads.service.ts Added optional thumbnail property to Download interface
ui/src/app/app.component.ts Added view mode state, thumbnail URL generation, and view switching logic
ui/src/app/app.component.sass Added CSS styles for view toggle buttons and thumbnail display
ui/src/app/app.component.html Implemented grid/list view toggle and grid layout with thumbnails
app/main.py Added thumbnail generation endpoint using ffmpeg

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +545 to +547
setView(mode: 'list' | 'grid') {
this.viewMode = mode; localStorage.setItem('completedView', mode);
}
Copy link

Copilot AI Sep 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The setView method should retrieve the saved view mode from localStorage on component initialization to persist user preference across sessions.

Copilot uses AI. Check for mistakes.
Comment on lines +327 to +330
<button type="button" class="btn" [ngClass]="viewMode==='list' ? 'btn-primary' : 'btn-outline-secondary'" (click)="setView ? setView('list') : (viewMode='list')">
<fa-icon [icon]="faList" class="me-1"></fa-icon> List
</button>
<button type="button" class="btn" [ngClass]="viewMode==='grid' ? 'btn-primary' : 'btn-outline-secondary'" (click)="setView ? setView('grid') : (viewMode='grid')">
Copy link

Copilot AI Sep 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The conditional check 'setView ?' is unnecessary since setView is always defined in the component. Simplify to just call setView('list') and setView('grid') directly.

Suggested change
<button type="button" class="btn" [ngClass]="viewMode==='list' ? 'btn-primary' : 'btn-outline-secondary'" (click)="setView ? setView('list') : (viewMode='list')">
<fa-icon [icon]="faList" class="me-1"></fa-icon> List
</button>
<button type="button" class="btn" [ngClass]="viewMode==='grid' ? 'btn-primary' : 'btn-outline-secondary'" (click)="setView ? setView('grid') : (viewMode='grid')">
<button type="button" class="btn" [ngClass]="viewMode==='list' ? 'btn-primary' : 'btn-outline-secondary'" (click)="setView('list')">
<fa-icon [icon]="faList" class="me-1"></fa-icon> List
</button>
<button type="button" class="btn" [ngClass]="viewMode==='grid' ? 'btn-primary' : 'btn-outline-secondary'" (click)="setView('grid')">

Copilot uses AI. Check for mistakes.
Comment on lines +327 to +330
<button type="button" class="btn" [ngClass]="viewMode==='list' ? 'btn-primary' : 'btn-outline-secondary'" (click)="setView ? setView('list') : (viewMode='list')">
<fa-icon [icon]="faList" class="me-1"></fa-icon> List
</button>
<button type="button" class="btn" [ngClass]="viewMode==='grid' ? 'btn-primary' : 'btn-outline-secondary'" (click)="setView ? setView('grid') : (viewMode='grid')">
Copy link

Copilot AI Sep 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The conditional check 'setView ?' is unnecessary since setView is always defined in the component. Simplify to just call setView('list') and setView('grid') directly.

Suggested change
<button type="button" class="btn" [ngClass]="viewMode==='list' ? 'btn-primary' : 'btn-outline-secondary'" (click)="setView ? setView('list') : (viewMode='list')">
<fa-icon [icon]="faList" class="me-1"></fa-icon> List
</button>
<button type="button" class="btn" [ngClass]="viewMode==='grid' ? 'btn-primary' : 'btn-outline-secondary'" (click)="setView ? setView('grid') : (viewMode='grid')">
<button type="button" class="btn" [ngClass]="viewMode==='list' ? 'btn-primary' : 'btn-outline-secondary'" (click)="setView('list')">
<fa-icon [icon]="faList" class="me-1"></fa-icon> List
</button>
<button type="button" class="btn" [ngClass]="viewMode==='grid' ? 'btn-primary' : 'btn-outline-secondary'" (click)="setView('grid')">

Copilot uses AI. Check for mistakes.
Comment on lines +348 to +350
@routes.get(config.URL_PREFIX + 'thumb')
async def thumb(request):
# Query: base=video|audio, file=<filename>, folder=<subdir or empty>, t=<seconds>
Copy link

Copilot AI Sep 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The thumbnail endpoint lacks input validation for the 't' parameter. Malicious values could be passed to ffmpeg. Consider validating that 't' is a valid number within reasonable bounds.

Copilot uses AI. Check for mistakes.
@DaKheera47
Copy link

yass bro, lets goo!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants