Skip to content

Commit

Permalink
Ensure filePath does not exceed maximum length, Fixes #176
Browse files Browse the repository at this point in the history
  • Loading branch information
Inrixia committed Jun 28, 2023
1 parent a64c124 commit e6c6993
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/lib/Video.ts
Expand Up @@ -81,6 +81,9 @@ export class Video {
.map((pathPart) => (pathPart.startsWith(".") ? pathPart : sanitize(pathPart)))
.join("/");

// Ensure filePath is not exceeding maximum length
if (this.filePath.length > 255) this.filePath = this.filePath.substring(0, 255);

this.folderPath = this.filePath.substring(0, this.filePath.lastIndexOf("/"));

this.artworkPath = `${this.filePath}${settings.artworkSuffix}`;
Expand Down

0 comments on commit e6c6993

Please sign in to comment.