Windows > Third Party Plug-ins, Programs, and Skins

ZStats tool to process [Play History] statistics, generate TOP N playlists

<< < (4/9) > >>

lepa:
Hi zybex! Do I need to calculate stats or can I run ONLY RunExpressions?

My use case for example is that:
BEFORE: Collect every movie name  (movies I have) to a list
AFTER: Check collected list against recommendations list and if match then enter item to field which tells me that I have that title which is recommended for this movie

(expressions are just sketch ups at this point so there may be errors)


--- Code: ---####################################################################################################
## ZStats config file
## Instructions: Read all comments in this file to learn about what each setting does
##
## [JRiver] section:
##   - check the MC connection info (MANDATORY)
##   - enable or disable ZStats functionality flags
##   - check if HistoryField matches your MC field name for Play History
##   - change other settings if needed on this section (defaults should be OK for most cases)
## [Stats] sections (if UpdateStats=1):
##   - check the config for each section; you can add more sections if needed
##   - set enabled=1 to activate a section. ZStats will update the [UpdateField] with the statistics
## [Playlists] section (if UpdatePlaylists=1):
##   - add or remove playlist definitions. ZStats will create/update the listed playlists
## [RunBefore] and [RunAfter] sections (if RunExpressions=1):
##   - Enter ExpressionLanguage code to be executed before/after processing the statistics

####################################################################################################
## MC server connection and global settings
####################################################################################################
[JRiver]
MCserver=https://localhost:52200      # alternative syntax
MCuser=user
MCpass=pw
MCFilter=[Media Sub Type]=[Movies]             # filter to limit processing to a given set of files

UpdateStats=0                           # 1 to update stats as defined in [Stats] sections, 0 to disable
UpdatePlaylists=0                       # 1 to enable playlist processing, 0 to disable
RunExpressions=1                        # 1 to execute [RunBefore] and [RunAfter] expression, 0 to disable
CreateFields=0                          # 1 to create missing output fields, 0 to disable (allow only update)

####################################################################################################
## expressions to execute on each file BEFORE statistics and playlists are updated
####################################################################################################
[RunBefore]
SaveAdd(;[Original Title]), v_MoviesList)

####################################################################################################
## expressions to execute on each file AFTER statistics and playlists are updated
####################################################################################################
[RunAfter]
#setField(Stats Updated, formatdate(now(),%c))
ListMix(If(ListContains([v_MoviesList],RemoveRight(ListItem([L1],1,/ /[),1)),SetField(RecInLibrary, [RecInLibrary];RemoveRight(ListItem([L1],1,/ /[),1),),,[Recommended Titles])

--- End code ---

zybex:
You can run only expressions. You may need to leave the other sections blank instead of removing them, not sure.

Though... you can get all your titles with this:

--- Code: ---fieldquery(media sub type, movies, name, 0, 1)
--- End code ---

lepa:
I re-added [Stats] and [Playlists] sections as blank

--- Code: ---[Stats]
enabled=0

[Playlists]
--- End code ---
I still get

Reading file list
  0 files read

Finished in 00:00:02


--- Quote from: zybex on May 15, 2022, 11:42:58 am ---Though... you can get all your titles with this:

--- Code: ---fieldquery(media sub type, movies, name, 0, 1)
--- End code ---

--- End quote ---
I though it could be painfully slow to do fieldquery for each file

zybex:
Try

--- Code: ---MCFilter=[Media Sub Type]=[Movie]
--- End code ---

You have an extra 's' there :P

Isn't fieldquery() cached? I think it only re-runs every five 60 seconds or something like that.

lepa:

--- Quote from: zybex on May 15, 2022, 01:51:41 pm ---You have an extra 's' there :P

--- End quote ---
  ::)
Thanks

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version