Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MediaMeta ¶
type MediaMeta struct {
Type MediaType
NewName string
RenameStatus RenameStatus
RenameError string
IsVirtual bool
NeedsDirectory bool
MarkedForDeletion bool
}
MediaMeta holds per-node rename intent and results.
Fields:
- Type: Media classification used for rule selection and statistics.
- NewName: Proposed final name (filename or directory name). Empty implies no change or unknown format.
- RenameStatus / RenameError: Outcome of the rename attempt. Error message is only populated when status == RenameStatusError.
- IsVirtual: True when the node does not (yet) exist on disk; used for synthesized movie directories wrapping loose video files.
- NeedsDirectory: Signals that a directory must be created before children are renamed beneath it (typically paired with IsVirtual).
- MarkedForDeletion: True when the file should be deleted during rename operation.
The zero value is meaningful: it encodes an untyped, unprocessed node with no rename proposal.
func EnsureMeta ¶
EnsureMeta returns the existing *MediaMeta for n, creating and attaching a new instance if needed. The returned pointer is always non-nil.
type MediaType ¶
type MediaType int
MediaType enumerates the semantic classification of a node within the media library hierarchy.
type RenameStatus ¶
type RenameStatus int
RenameStatus represents the lifecycle stage of a proposed rename operation. A node starts at RenameStatusNone; after execution it is marked success or error with an accompanying message when relevant.
const ( RenameStatusNone RenameStatus = iota // Rename not yet attempted, or no change needed RenameStatusSuccess // Rename succeeded RenameStatusError // Rename failed; see RenameError for detail )
type SimpleFileInfo ¶
type SimpleFileInfo struct {
// contains filtered or unexported fields
}
SimpleFileInfo implements os.FileInfo for synthetic (virtual) nodes inserted into the tree (e.g. wrapping a standalone movie file in a virtual directory before materialization on disk).
func NewSimpleFileInfo ¶
func NewSimpleFileInfo(name string, isDir bool) *SimpleFileInfo
func (*SimpleFileInfo) IsDir ¶
func (m *SimpleFileInfo) IsDir() bool
func (*SimpleFileInfo) ModTime ¶
func (m *SimpleFileInfo) ModTime() time.Time
func (*SimpleFileInfo) Mode ¶
func (m *SimpleFileInfo) Mode() os.FileMode
func (*SimpleFileInfo) Name ¶
func (m *SimpleFileInfo) Name() string
func (*SimpleFileInfo) Size ¶
func (m *SimpleFileInfo) Size() int64
func (*SimpleFileInfo) Sys ¶
func (m *SimpleFileInfo) Sys() any