JakeWharton / JakeWharton/plex-orphaned-files

Doesn't seem to work well with Windows

Open
#16 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Kotlin
Stars
123
Forks
6
Avg merge
1h 52m
Merged PRs (30d)
18

Description

I run using docker like so:
```bash
PS C:\Users\x> docker run -v X:\Films:/mnt/films jakewharton/plex-orphaned-files:1 exec plex-orphaned-files --base-url https://x:32400/ --token x--folder-mapping /mnt/films:/media/films Films
Exception in thread "main" java.nio.file.NoSuchFileException: X:\Films
at sun.nio.fs.UnixException.translateToIOException(UnixException.java:86)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
at sun.nio.fs.UnixFileAttributeViews$Basic.readAttributes(UnixFileAttributeViews.java:55)
at sun.nio.fs.UnixFileSystemProvider.readAttributes(UnixFileSystemProvider.java:144)
at sun.nio.fs.LinuxFileSystemProvider.readAttributes(LinuxFileSystemProvider.java:99)
at java.nio.file.Files.readAttributes(Files.java:1737)
at java.nio.file.FileTreeWalker.getAttributes(FileTreeWalker.java:219)
at java.nio.file.FileTreeWalker.visit(FileTreeWalker.java:276)
at java.nio.file.FileTreeWalker.walk(FileTreeWalker.java:322)
at java.nio.file.FileTreeIterator.(FileTreeIterator.java:72)
at java.nio.file.Files.walk(Files.java:3574)
at java.nio.file.Files.walk(Files.java:3625)
at com.jakewharton.plex.OrphanedFiles.find(orphanedFiles.kt:50)
at com.jakewharton.plex.OrphanedFiles$find$1.invokeSuspend(orphanedFiles.kt)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:274)
at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:84)
at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:59)
at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source)
at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:38)
at kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source)
at com.jakewharton.plex.OrphanedFilesCommand.run(main.kt:109)
at com.github.ajalt.clikt.parsers.Parser.parse(Parser.kt:171)
at com.github.ajalt.clikt.parsers.Parser.parse(Parser.kt:16)
at com.github.ajalt.clikt.core.CliktCommand.parse(CliktCommand.kt:395)
at com.github.ajalt.clikt.core.CliktCommand.parse$default(CliktCommand.kt:392)
at com.github.ajalt.clikt.core.CliktCommand.main(CliktCommand.kt:410)
at com.github.ajalt.clikt.core.CliktCommand.main(CliktCommand.kt:435)
at com.jakewharton.plex.Main.main(main.kt:125)
```
So I change to:
```bash
PS C:\Users\x> docker run -v X:\Films:/mnt/films jakewharton/plex-orphaned-files:1 exec plex-orphaned-files --base-url https://x:32400/ --token x--folder-mapping X:\Films:/mnt/films Films
Exception in thread "main" java.nio.file.NoSuchFileException: \Films:/mnt/films:\Films
at sun.nio.fs.UnixException.translateToIOException(UnixException.java:86)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
at sun.nio.fs.UnixFileAttributeViews$Basic.readAttributes(UnixFileAttributeViews.java:55)
at sun.nio.fs.UnixFileSystemProvider.readAttributes(UnixFileSystemProvider.java:144)
at sun.nio.fs.LinuxFileSystemProvider.readAttributes(LinuxFileSystemProvider.java:99)
at java.nio.file.Files.readAttributes(Files.java:1737)
at java.nio.file.FileTreeWalker.getAttributes(FileTreeWalker.java:219)
at java.nio.file.FileTreeWalker.visit(FileTreeWalker.java:276)
at java.nio.file.FileTreeWalker.walk(FileTreeWalker.java:322)
at java.nio.file.FileTreeIterator.(FileTreeIterator.java:72)
at java.nio.file.Files.walk(Files.java:3574)
at java.nio.file.Files.walk(Files.java:3625)
at com.jakewharton.plex.OrphanedFiles.find(orphanedFiles.kt:50)
at com.jakewharton.plex.OrphanedFiles$find$1.invokeSuspend(orphanedFiles.kt)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:274)
at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:84)
at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:59)
at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source)
at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:38)
at kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source)
at com.jakewharton.plex.OrphanedFilesCommand.run(main.kt:109)
at com.github.ajalt.clikt.parsers.Parser.parse(Parser.kt:171)
at com.github.ajalt.clikt.parsers.Parser.parse(Parser.kt:16)
at com.github.ajalt.clikt.core.CliktCommand.parse(CliktCommand.kt:395)
at com.github.ajalt.clikt.core.CliktCommand.parse$default(CliktCommand.kt:392)
at com.github.ajalt.clikt.core.CliktCommand.main(CliktCommand.kt:410)
at com.github.ajalt.clikt.core.CliktCommand.main(CliktCommand.kt:435)
at com.jakewharton.plex.Main.main(main.kt:125)
```
I think this doesn't transcode `X:` very well in Windows paths, is there a way to fix this?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at orphanedFiles.kt:50, where the Windows path fails, and main.kt:109, where the command is invoked. Reproduce both Docker commands from the issue and trace how the folder mapping is passed to the file walk. Done means a Windows-mounted path can be mapped to the container path without producing a NoSuchFileException.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, kotlin
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.