How to add spaces between words?

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
boe
Posts: 35
Joined: 12 Jun 2016, 15:59

How to add spaces between words?

Post by boe »

Hello,

I'd like to put some additional info at the end of the movie main information. When I tried to do this I couldn't figure out how to add spaces.

For example I started out with The Transporter Refueled. I got it close with:

Code: Select all

{n.sortName('$2, $1')} - {y}  ({vf}, {AC} {channels}, {certification}, {minutes} minutes)

Code: Select all

Transporter Refueled, The - 2015 (1080p, DTS 7.1, PG-13, 96 minutes).mkv
I'd like it to look like this please -

Code: Select all

Transporter Refueled, The - 2015 (1080p,  DS  DTS 7.1,  DS  PG-13,  DS   96 minutes).mkv
Also if there is a way to say DTS:X, DTS:HD, Dolby Atmos etc that would be great but I don't know how to do that.

Great program! I recommend it highly!


EDIT - just noticed this web page also takes out double spaces so I'll use DS instead of tapping space twice since that doesn't show. I don't actually want DS I want two spaces between words but even here I don't know how to make that happen.
User avatar
rednoah
The Source
Posts: 22990
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: How to add spaces between words?

Post by rednoah »

1.
After applying your format, the result will be sanitized. FileBot will not allow multiple spaces, new lines, non-breaking spaces, etc and normalize the filename accordingly.

There might be room for some trickery with some unicode characters, but I'd highly discourage you from using invisible non-ASCII characters in filenames. ;)


2.
Is the audio information you seek available via MediaInfo?
viewtopic.php?f=5&t=4285
:idea: Please read the FAQ and How to Request Help.
boe
Posts: 35
Joined: 12 Jun 2016, 15:59

Re: How to add spaces between words?

Post by boe »

Thanks! I guess I can live without the spaces.

I'm not sure if my question was clear but I currently have it showing DTS for audio - is there a way to get the version of DTS - e.g. DTS:X? I don't see that in the link so perhaps not.
User avatar
rednoah
The Source
Posts: 22990
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: How to add spaces between words?

Post by rednoah »

It's probably possible: viewtopic.php?f=6&t=4182&p=23506#p23506

Atmos TrueHD should work according to the MediaInfo posted in that thread.

But I don't have DTS:X files to test with so I don't know for sure. Please copy & paste the Audio information from the Media Inspector Dialog so I can have a look.

Image
:idea: Please read the FAQ and How to Request Help.
boe
Posts: 35
Joined: 12 Jun 2016, 15:59

Re: How to add spaces between words?

Post by boe »

Thanks - I'm using windows so it looks different but it is in the Format Profile field

This was for The Expendables
Audio #1
ID : 2
ID in the original source medium : 4352 (0x1100)
Format : TrueHD
Format profile : TrueHD+Atmos / TrueHD
Codec ID : A_TRUEHD
Duration : 2 h 12 min
Bit rate mode : Variable
Bit rate : 5 177 kb/s
Maximum bit rate : 7 467 kb/s
Channel(s) : Object Based / 8 channels
Channel positions : Object Based / Front: L C R, Side: L R, Back: L R, LFE
Sampling rate : / 48.0 kHz
Frame rate : 1 200.000 FPS (40 spf)
Bit depth : 24 bits
Compression mode : Lossless
Stream size : 4.78 GiB (20%)
Title : Surround 7.1
Language : English
Default : Yes
Forced : No


So ideally i'd combine variables to get it to say Dolby Atmos/TrueHD

This is for Crimson Peak
Audio #1
ID : 2
ID in the original source medium : 4352 (0x1100)
Format : DTS
Format/Info : Digital Theater Systems
Format profile : X / MA / Core
Mode : 16
Format settings, Endianness : Big
Codec ID : A_DTS
Duration : 1 h 58 min
Bit rate mode : Variable / Variable / Constant
Bit rate : 6 035 kb/s / 6 035 kb/s / 1 509 kb/s
Channel(s) : Object Based / 8 channels / 6 channels
Channel positions : Object Based / Front: L C R, Side: L R, Back: L R, LFE / Front: L C R, Side: L R, LFE
Sampling rate : / 48.0 kHz / 48.0 kHz
Frame rate : 93.750 FPS (512 spf)
Bit depth : / 24 bits / 24 bits
Compression mode : / Lossless / Lossy
Stream size : 5.01 GiB (16%)
Title : Surround 7.1
Language : English
Default : Yes
Forced : No

Ideally this would be listed as DTS:X/MA
User avatar
rednoah
The Source
Posts: 22990
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: How to add spaces between words?

Post by rednoah »

I think you're using the MediaInfo application. This is less useful for our purpose here. Please use FileBot. It'll look almost exactly like on the screenshot.

Open FileBot Image ➔ Edit Format Image ➔ Change Sample Image ➔ Open MediaInfo Image ➔ Click Audio Tab ➔ CTRL+A, CTRL+C
:idea: Please read the FAQ and How to Request Help.
boe
Posts: 35
Joined: 12 Jun 2016, 15:59

Re: How to add spaces between words?

Post by boe »

I appreciate your help .

Here is the info from Crimson Peak from Media info
OriginalSourceMedium_ID 4352
OriginalSourceMedium_ID/String 4352 (0x1100)
Format DTS
Format/Info Digital Theater Systems
Format_Commercial DTS
Format_Profile X / MA / Core
Format_Settings_Mode 16
Format_Settings_Endianness Big
CodecID A_DTS
Codec DTS-HD
Codec/String DTS-HD
Codec/Family DTS
Duration 7123744.000000
Duration/String 1 h 58 min
Duration/String1 1 h 58 min 43 s 744 ms
Duration/String2 1 h 58 min
Duration/String3 01:58:43.744
Duration/String4 01:58:24:75
Duration/String5 01:58:43.744 (01:58:24:75)
BitRate_Mode VBR / VBR / CBR
BitRate_Mode/String Variable / Variable / Constant
BitRate 6035371 / 6035371 / 1509000
BitRate/String 6 035 kb/s / 6 035 kb/s / 1 509 kb/s
Channel(s) Object Based / 8 / 6
Channel(s)/String Object Based / 8 channels / 6 channels
ChannelPositions Object Based / Front: L C R, Side: L R, Back: L R, LFE / Front: L C R, Side: L R, LFE
ChannelPositions/String2 Object Based / 3/2/2.1 / 3/2/0.1
ChannelLayout Object Based / / C L R Ls Rs LFE
SamplesPerFrame 512
SamplingRate / 48000 / 48000
SamplingRate/String / 48.0 kHz / 48.0 kHz
FrameRate 93.750
FrameRate/String 93.750 FPS (512 spf)
Resolution / 24 / 24
Resolution/String / 24 bits / 24 bits
BitDepth / 24 / 24
BitDepth/String / 24 bits / 24 bits
Compression_Mode / Lossless / Lossy
Compression_Mode/String / Lossless / Lossy
Delay 0
Delay/String3 00:00:00.000
Delay_Source Container
Delay_Source/String Container
Video_Delay 0
Video_Delay/String3 00:00:00.000
Video0_Delay 0
Video0_Delay/String3 00:00:00.000
StreamSize 5374305132
StreamSize/String 5.01 GiB (16%)
StreamSize/String1 5 GiB
StreamSize/String2 5.0 GiB
StreamSize/String3 5.01 GiB
StreamSize/String4 5.005 GiB
StreamSize/String5 5.01 GiB (16%)
StreamSize_Proportion 0.15551
Title Surround 7.1
Language en
Language/String English
Language/String1 English
Language/String2 en
Language/String3 eng
Language/String4 en
Default Yes
Default/String Yes
Forced No
Forced/String No




Here is the info from the Expendables3 from media info

OriginalSourceMedium_ID 4352
OriginalSourceMedium_ID/String 4352 (0x1100)
Format Atmos / TrueHD
Format_Commercial TrueHD
CodecID A_TRUEHD
CodecID/Url http://www.dolby.com/consumer/technology/trueHD.html
Codec Atmos / TrueHD
Codec/String Atmos / TrueHD
Duration 7934469.000000
Duration/String 2 h 12 min
Duration/String1 2 h 12 min 14 s 469 ms
Duration/String2 2 h 12 min
Duration/String3 02:12:14.469
Duration/String5 02:12:14.469
BitRate_Mode VBR
BitRate_Mode/String Variable
BitRate 5176692
BitRate/String 5 177 kb/s
BitRate_Maximum 7467000
BitRate_Maximum/String 7 467 kb/s
Channel(s) Object Based / 8
Channel(s)/String Object Based / 8 channels
ChannelPositions Object Based / Front: L C R, Side: L R, Back: L R, LFE
ChannelPositions/String2 Object Based / 3/2/2.1
SamplesPerFrame 40
SamplingRate / 48000
SamplingRate/String / 48.0 kHz
FrameRate 1200.000
FrameRate/String 1 200.000 FPS (40 spf)
Resolution 24
Resolution/String 24 bits
BitDepth 24
BitDepth/String 24 bits
Compression_Mode Lossless
Compression_Mode/String Lossless
Delay 0
Delay/String3 00:00:00.000
Delay_Source Container
Delay_Source/String Container
Video_Delay 0
Video_Delay/String3 00:00:00.000
Video0_Delay 0
Video0_Delay/String3 00:00:00.000
StreamSize 5134288274
StreamSize/String 4.78 GiB (20%)
StreamSize/String1 5 GiB
StreamSize/String2 4.8 GiB
StreamSize/String3 4.78 GiB
StreamSize/String4 4.782 GiB
StreamSize/String5 4.78 GiB (20%)
StreamSize_Proportion 0.20011
Title Surround 7.1
Language en
Language/String English
Language/String1 English
Language/String2 en
Language/String3 eng
Language/String4 en
Default Yes
Default/String Yes
Forced No
Forced/String No

I could be wrong it looks like I'd want audio format and audio format profile if it was available.
User avatar
rednoah
The Source
Posts: 22990
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: How to add spaces between words?

Post by rednoah »

1.
You can use audio[0].FormatProfile to access that field of data and then do whatever you want with that.

A. transform the data whatever it may be:

Code: Select all

audio[0].Format.slash('.')}{'-'+audio[0].FormatProfile.slash('.')
or

Code: Select all

audio[0].with{ allOf{Format}{FormatProfile}.join('-').slash('.') }

B. check the data and then do your own thing:

Code: Select all

audio[0].FormatProfile =~ 'X / MA' ? 'DTS-X-MA' : ac

2.
{ac} should give you Atmos TrueHD in the second sample file.
:idea: Please read the FAQ and How to Request Help.
boe
Posts: 35
Joined: 12 Jun 2016, 15:59

Re: How to add spaces between words?

Post by boe »

Thanks!

I apologize but I'm doing something wrong.

My original is
{n.sortName('$2, $1')} - {y} ({vf}, {AC} {channels}, {certification}, {minutes} minutes)
Resident Evil The Final Chapter - 2016 (1080p, DTS 7.1, R, 106 minutes)

I'm trying
{n.sortName('$2, $1')} - {y} ({vf}, {audio[0].FormatProfile =~ 'X / MA' ? 'DTS-X-MA' : ac} {channels}, {certification}, {minutes} minutes)

Gives me the same thing - can you let me know what I should have put? I'd like it to output -
Resident Evil The Final Chapter - 2016 (1080p, DTS X /MA 7.1, R, 106 minutes)
User avatar
rednoah
The Source
Posts: 22990
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: How to add spaces between words?

Post by rednoah »

This expression:

Code: Select all

{audio[0].FormatProfile =~ 'X / MA' ? 'DTS-X-MA' : ac}
could not possibly ever give you this result:

Code: Select all

X /MA
(Even if this is the FormatProfile value, why is there a missing space? This makes no sense!)

It's impossible. Double check your stuff. Extraordinary claims require extraordinary proof (i.e. screenshots). ;)

It's either gonna be DTS-X-MA or whatever the value of ac is.

If you are indeed getting X /MA then we know that you're not using the format you think you're using.
:idea: Please read the FAQ and How to Request Help.
boe
Posts: 35
Joined: 12 Jun 2016, 15:59

Re: How to add spaces between words?

Post by boe »

Right - I'm not claiming I did get it working. I said this is what I'd LIKE to get. What I'm asking for is help getting it to work. I'm trying to use the examples you gave but I'm doing something wrong.
boe
Posts: 35
Joined: 12 Jun 2016, 15:59

Re: How to add spaces between words?

Post by boe »

Thanks - I think I know what you were suggesting now!

{n.sortName('$2, $1')} - {y} ({vf}, {audio[0].with{ allOf{Format}{FormatProfile}.join('-').slash('.') }} {channels}, {certification}, {minutes} minutes)
User avatar
rednoah
The Source
Posts: 22990
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: How to add spaces between words?

Post by rednoah »

I see. I was confused because in your example you have a / in your destination filename, creating a weird folder structure for certain DTS files. That would be really stupid for obvious reasons. :lol:
:idea: Please read the FAQ and How to Request Help.
boe
Posts: 35
Joined: 12 Jun 2016, 15:59

Re: How to add spaces between words?

Post by boe »

I think I have a way to put spaces between words but need your smarts in the code.
I think if I could replace values with a space and then slide them between words.
In your FAQ you use this code - {n.space('.')} I know some values on mine are going to be en for English. I was wondering if I could put some sort of code that converted the variable for en to (' '). Again I don't know how to program so I'm just trying to ask if there is a way to change a value to a space and then add that between items such as {n} and [{y}]
If not can we get a feature request to add spaces between values in a future addition?
User avatar
rednoah
The Source
Posts: 22990
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: How to add spaces between words?

Post by rednoah »

1 space, or many spaces?

1 space is obviously not a problem:

Code: Select all

{n} [{y}]
A sequence of spaces is not allowed. I cannot think of a situation where that would make sense. Why do you want multiple spaces in a row? What's the benefit?
:idea: Please read the FAQ and How to Request Help.
boe
Posts: 35
Joined: 12 Jun 2016, 15:59

Re: How to add spaces between words?

Post by boe »

For me it is easier to read when there are a lot of details so close together.
Post Reply