Media build part 2 (unreleased): drive wiring in every app (R-1024/R-1037), old-install repair (R-1047), drive events notice + real restart now/later + stream check, file browser lets go of dead/removed drives and recreates on return (R-1038), safe removal keeps the drive (R-1044), Plex claim on the running server + probe accept (R-1028/R-1045)
gates / gates (push) Successful in 45s
gates / gates (push) Successful in 45s
Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS
This commit is contained in:
1 parent
78c894234c
commit
f580d88a14
46 files changed
+3700
-8
No files matched your search
@@ -86,6 +86,8 @@ func (m *Manager) mediaDrives() []MediaDrive {
|
||||
seen[p] = true
|
||||
d := MediaDrive{Path: p, Present: true}
|
||||
switch {
|
||||
case sp.Disconnected || sp.EjectedAt != "":
|
||||
d.Present, d.Why = false, "removed"
|
||||
case !isMount(p):
|
||||
d.Present, d.Why = false, "not mounted"
|
||||
case system.MountIsShutdown(p):
|
||||
@@ -324,3 +326,14 @@ func (m *Manager) defaultMediaDrive() string {
|
||||
}
|
||||
return first
|
||||
}
|
||||
|
||||
// PresentMediaDrives is the drives the media apps bind now (present, enrolled, not network, not removed).
|
||||
func (m *Manager) PresentMediaDrives() []string {
|
||||
var out []string
|
||||
for _, d := range m.mediaDrives() {
|
||||
if d.Present {
|
||||
out = append(out, d.Path)
|
||||
}
|
||||
}
|
||||
return out
|
||||
}
|
||||
Reference in new issue
Block a user