.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Media::Scan 3pm" .TH Media::Scan 3pm "2023-05-03" "perl v5.36.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SS "new( \e@paths, \e%options )" .IX Subsection "new( @paths, %options )" Create a new Media::Scan instance and begin scanning. .PP paths may be a single scalar path, or an array reference with multiple paths. .PP options include: .IP "loglevel (default: \s-1MS_LOG_ERR\s0)" 4 .IX Item "loglevel (default: MS_LOG_ERR)" One of the following levels: .Sp .Vb 5 \& MS_LOG_ERR \& MS_LOG_WARN \& MS_LOG_INFO \& MS_LOG_DEBUG \& MS_LOG_MEMORY .Ve .IP "async (default: 0)" 4 .IX Item "async (default: 0)" If set to 1, all scanning is performed in a background thread, and the call to \fBnew()\fR will return immediately. Make sure to keep a reference to the Media::Scan object, or the scan will be aborted at DESTROY-time. .IP "cachedir (default: current dir)" 4 .IX Item "cachedir (default: current dir)" An optional path for libmediascan to store some cache files. .IP "flags (default: \s-1MS_USE_EXTENSION\s0 | \s-1MS_FULL_SCAN\s0)" 4 .IX Item "flags (default: MS_USE_EXTENSION | MS_FULL_SCAN)" An \s-1OR\s0'ed list of flags, the possible flags are: .Sp .Vb 7 \& MS_USE_EXTENSION \- Use a file\*(Aqs extension to determine how to scan it. \& MS_FULL_SCAN \- Perform a full scan on every file. \& MS_RESCAN \- Only scan files that are new or have changed since the last scan. \& MS_INCLUDE_DELETED \- The result callback will be called for files that have been deleted \& since the last scan. \& MS_WATCH_CHANGES \- Continue watching for changes after the scan has completed. \& MS_CLEARDB \- Wipe the internal libmediascan database before scanning. .Ve .IP "ignore (default: none)" 4 .IX Item "ignore (default: none)" An array reference of file extensions that should be skipped. You may also specify 3 special types: .Sp .Vb 3 \& AUDIO \- Ignore all audio files. \& IMAGE \- Ignore all image files. \& VIDEO \- Ignore all video files. .Ve .IP "ignore_dirs (default: none)" 4 .IX Item "ignore_dirs (default: none)" An array reference of directory substrings that should be skipped, for example the iTunes container directories \*(L".ite\*(R" and \*(L".itlp\*(R" or the Windows directory \*(L"\s-1RECYCLER\*(R".\s0 The substrings are case-sensitive. .IP "thumbnails (default: none)" 4 .IX Item "thumbnails (default: none)" An arrayref of hashes with one or more thumbnail specifications. Thumbnails are created during the scanning process and are available within the result callback. .Sp The format of a thumbnail spec is: .Sp .Vb 7 \& { format => \*(AqAUTO\*(Aq, # or JPEG or PNG \& width => 100, \& height => 100, \& keep_aspect => 1, \& bgcolor => 0xffffff, \& quality => 90, \& } .Ve .Sp Most values are optional, however at least width or height must be specified. .IP "on_result" 4 .IX Item "on_result" A callback that will be called for each scanned file. The function will be passed a Media::Scan::Audio, Media::Scan::Video, or Media::Scan::Image depending on the file type. This callback is required. .IP "on_error" 4 .IX Item "on_error" An callback that will be called when a scanning error occurs. It is passed a Media::Scan::Error. .IP "on_progress" 4 .IX Item "on_progress" An optional callback that will be passed a Media::Scan::Progress at regular intervals during scanning. .IP "on_finish" 4 .IX Item "on_finish" An optional callback that is called when scanning has finished. Nothing is currently passed to this callback, eventually a scanning summary and overall stats might be included here.