Skip to content

Commit

Permalink
new CD examples, usage tips, new searching criteria, speedup launching
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrj committed Nov 19, 2023
1 parent af90bc0 commit 7e2bd68
Show file tree
Hide file tree
Showing 3 changed files with 595 additions and 539 deletions.
13 changes: 10 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,26 @@ Custom data extractor is a command that can be invoked with a single parameter -

> "7z l" - Listing the contents of the archive. Applicable to files like *.7z, *.zip, etc. (linux)
> "C:\Program Files\7-Zip\7z.exe l" - Listing the contents of the archive (windows)
> "C:\Program Files\\[7-Zip](https://www.7-zip.org)\7z.exe l" - Listing the contents of the archive (windows)
> "cat" - Listing the contents of the entire file. May be applied to *.cue files or media playlists *.m3u or any text files (Linux)
> "cmd /c more" - Listing the contents of the entire file. May be applied to *.cue files or media playlists *.m3u or any text files (windows)
> "md5sum" - use it if you want to store the checksum of a file
> "[ffprobe](https://ffmpeg.org/ffprobe.html) -hide_banner" - get media tags and other metadata from media files like *.mp3 etc.
> "anything.sh" - maybe not exactly "anything", but use your own script to apply more complex criteria to individual files and process the data to be stored.
> "[exiftool](https://exiftool.sourceforge.net/)" get exif data from images like *.jpg and many more
> "[pdftotext](https://linux.die.net/man/1/pdftotext) - - <" - get text content of pdf file
> "strings" - get printable strings from any file
> "anything.sh/anything.bat" - maybe not exactly "anything", but use your own script to apply more complex criteria to individual files and process the data to be stored.
## Usage tips:
- don't put any destructive actions in your Custom Data Extractors scrips
- try to keep as little custom data as possible, to speed up scanning and searching records and keep record files small
- if general purpose and generally available tools produce too much and not needed text data, write a wrapper script (*.sh, *bat) executing specific tool and post-process retrieved data. Wrapper can also help when the tool expects more variable parameters or in an unusual order


## Supported platforms:
Expand Down
8 changes: 6 additions & 2 deletions src/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ def extract_custom_data(self):

self.save()

search_kind_code_tab={'dont':0,'without':1,'error':2,'regexp':3,'glob':4,'fuzzy':5}
search_kind_code_tab={'dont':0,'without':1,'any':2,'error':3,'regexp':4,'glob':5,'fuzzy':6}

def set_data(self):
size,mtime = 0,0
Expand All @@ -571,6 +571,7 @@ def find_items(self,
regexp_kind_code = self.search_kind_code_tab['regexp']
glob_kind_code = self.search_kind_code_tab['glob']
without_kind_code = self.search_kind_code_tab['without']
any_kind_code = self.search_kind_code_tab['any']
error_kind_code = self.search_kind_code_tab['error']
fuzzy_kind_code = self.search_kind_code_tab['fuzzy']

Expand Down Expand Up @@ -653,7 +654,10 @@ def find_items(self,
#if cd_search_kind_code==dont_kind_code:
# pass

if cd_search_kind_code_is_rgf:
if cd_search_kind_code==any_kind_code:
if not has_cd or not cd_ok:
continue
elif cd_search_kind_code_is_rgf:
if has_cd and cd_ok:
cd_data = fifth_field
else:
Expand Down
Loading

0 comments on commit 7e2bd68

Please sign in to comment.