INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Expression Writing: If Statement using AND  (Read 958 times)

dreandre

  • Junior Woodchuck
  • **
  • Posts: 66
Expression Writing: If Statement using AND
« on: April 07, 2019, 04:00:05 pm »

Writing expressions in the Rename, Move & Copy Files

The Problem:

I would like to move animated TV Shows and Animated Movies into the same folder called "Animation".

TV Shows should be named "S01E01 [Name]"
Movies should be named "[Name] ([Year])"


Question:

How can I write and IF statement that will check [Grouping] for Animation AND [Media Sub Type] for "Movie" or "TV Show"?

In Excel syntax, I would write:  IF(AND([Grouping]=Animation,[Media Sub Type]=Movie),Value if True,Value if False)

Is there a similar way to write the IF statement to check two criteria to determine the True Value, else False?

Thanks All!!
Logged

dreandre

  • Junior Woodchuck
  • **
  • Posts: 66
Re: Expression Writing: If Statement using AND
« Reply #1 on: April 07, 2019, 04:22:04 pm »

I think I may have solved it.

It seems the solution was to write part of the rule in the Directories section, and the other part of the rule in the Filename Section.  Here's what I wrote that seems to work:

In the Directories Section I wrote this rule:

Ifelse(isequal([grouping],Animation,1),Animation\,isequal([grouping],Extras,1),Media Extras\,isequal([grouping],Documentary,1),Documentary\)

**** I didn't mention that I was also moving extras and documentaries as well.  ****

In the Filename Section I wrote this rule:

if(isequal([media sub type],TV Show),\[Series]\[Season]\S[Season]E[Episode] [Name],Filefolder()\[Name] ([year]))

****This rule has an error in it that I posted in a different thread.  If I can solve this error then I will be home free! ****

Let me know if there is anything I could have done differently or better.  Thanks All!
Logged

dreandre

  • Junior Woodchuck
  • **
  • Posts: 66
Re: Expression Writing: If Statement using AND
« Reply #2 on: April 07, 2019, 05:16:02 pm »

Logged

RoderickGI

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 8186
Re: Expression Writing: If Statement using AND
« Reply #3 on: April 07, 2019, 07:26:56 pm »

Ifelse(isequal([grouping],Animation,1),Animation\,isequal([grouping],Extras,1),Media Extras\,isequal([grouping],Documentary,1),Documentary\)

"\Media Extras\ is not supported by the MC "Extras" functionality, if that is what you are trying to use. See below for a summary of that. If oyu are just putting a bunch of extra stuff in a separate sub-directory, fair enough.

****This rule has an error in it that I posted in a different thread.  If I can solve this error then I will be home free! ****

Done.

Quote from: RoderickGI
View Extras functionality

22.0.21 (8/24/2016)
4. NEW: When files have sidecar images, PDF files, or documents, they'll be shown in a "View Extras" submenu to open each individual file.
22.0.22 (8/29/2016)
2. Changed: Add text files to the list of "View Extras" files.
22.0.23 (8/31/2016)
1. NEW: Added HTM and HTML to the list of sidecars shown by the new View Extras menu.
3. Fixed: The View Extras menu in images would show all the images in the same folder.
5. Changed: Sidecar searching for the "View Extras" menu also looks in subfolders called "Extras", "Scans", "PDF", "PDFs", "Booklet", "Art", "Artwork", "Cover", "Covers", "Cover Scan", or "Cover Scans".
22.0.24 (9/2/2016)
2. Changed: When viewing a sidecar image with the View Extras menu, it will add all the images it found to the current playlist so you can switch between them like normal image playback.
3. Changed: Added the extension to the list of View Extras menu choices.
22.0.27 (9/19/2016)
1. NEW: Added the option "View Cover Art" to the View Extras menu.
22.0.30 (9/22/2016)
1. Changed: Added the subfolder "Album Artworks" to the View Extras search.
22.0.96 (4/3/2017)
1. Changed: Added RTF to the list of extensions the View Extras menu searches for.
22.0.98 (4/10/2017)
3. Fixed: RTF files in the View Extras menu weren't opening.
23.0.2 (6/9/2017)
1. NEW: The View extras menu looks for a zip file named "Artwork.zip" and shows the artwork in the zip file if it exists.


File Types Supported:
PDF, Documents (for example: doc, docx, docm, odt), Text, HTM, HTML, RTF, "Artwork.zip", jpg, png
File types jpg and png are viewed within MC. All other files types are opened with the default Windows application, as defined by File Type Associations.
Note: Artwork.zip is only opened with the contents presented for viewing if the zip file is in the same directory as the audio files, and won't be opened if it is in one of the Extras sub-directories.
Not supported: mht, wps, xml, xps, bmp, tif, gif,

Folders Searched:
 "Extras", "Scans", "PDF", "PDFs", "Booklet", "Art", "Artwork", "Cover", "Covers", "Cover Scan",  "Cover Scans", "Album Artworks"
Note: These folders are not moved by the RM&CF function, regardless of the "Move all non-imported files in folder with selected media files". flag.

Special Function:
"View Cover Art", which views the Cover Art image MC knows about, in the same way that "right-click > Cover Art > View (first file)" does.
Logged
What specific version of MC you are running:MC27.0.27 @ Oct 27, 2020 and updating regularly Jim!                        MC Release Notes: https://wiki.jriver.com/index.php/Release_Notes
What OS(s) and Version you are running:     Windows 10 Pro 64bit Version 2004 (OS Build 19041.572).
The JRMark score of the PC with an issue:    JRMark (version 26.0.52 64 bit): 3419
Important relevant info about your environment:     
  Using the HTPC as a MC Server & a Workstation as a MC Client plus some DLNA clients.
  Running JRiver for Android, JRemote2, Gizmo, & MO 4Media on a Sony Xperia XZ Premium Android 9.
  Playing video out to a Sony 65" TV connected via HDMI, playing digital audio out via motherboard sound card, PCIe TV tuner
Pages: [1]   Go Up