Movie Mode : hr:min:sec format

Support for Windows users
Post Reply
RBCC
Posts: 118
Joined: 17 May 2016, 02:23

Movie Mode : hr:min:sec format

Post by RBCC »

I would like to use hours,minutes and seconds to achieve the duration of a movie in the format of hours : minutes : seconds for example using 412 seconds is 6 minutes and 56 seconds or 6:56 . if the math is 412/60 = 6 and56/60 seconds. how is this done ? so the output is 6:56 thank you for the help! John
User avatar
rednoah
The Source
Posts: 20924
Joined: 16 Nov 2011, 08:59

Re: Movie Mode : hr:min:sec format

Post by rednoah »

e.g.

Code: Select all

{ duration.format('HH∶mm∶ss') }
:idea: We're using ∶ ratio instead of : colon since the latter is not allowed in file paths.
:idea: Please read the FAQ and How to Request Help.
RBCC
Posts: 118
Joined: 17 May 2016, 02:23

Re: Movie Mode : hr:min:sec format

Post by RBCC »

using {d} can I format it like dec/25/2023?
User avatar
rednoah
The Source
Posts: 20924
Joined: 16 Nov 2011, 08:59

Re: Movie Mode : hr:min:sec format

Post by rednoah »

e.g.

Code: Select all

{ d.format('MMM dd yyyy') }
:idea: Note that / is not allowed in file names.
:idea: Please read the FAQ and How to Request Help.
RBCC
Posts: 118
Joined: 17 May 2016, 02:23

Re: Movie Mode : hr:min:sec format

Post by RBCC »

IS there a way I can create an array to hold these :
array[1]="Sports"
array[2]="how to"
array[3} ="shorts"
Thank you for any Ideas , John
User avatar
rednoah
The Source
Posts: 20924
Joined: 16 Nov 2011, 08:59

Re: Movie Mode : hr:min:sec format

Post by rednoah »

:idea: Please read the FAQ and How to Request Help.
RBCC
Posts: 118
Joined: 17 May 2016, 02:23

Re: Movie Mode : hr:min:sec format

Post by RBCC »

Can I use that in to GUI??
User avatar
rednoah
The Source
Posts: 20924
Joined: 16 Nov 2011, 08:59

Re: Movie Mode : hr:min:sec format

Post by rednoah »

Yes. Format Expressions work the same in GUI and CLI.
:idea: Please read the FAQ and How to Request Help.
RBCC
Posts: 118
Joined: 17 May 2016, 02:23

Re: Movie Mode : hr:min:sec format

Post by RBCC »

can I see an example of it in GUI? thank you, John
User avatar
rednoah
The Source
Posts: 20924
Joined: 16 Nov 2011, 08:59

Re: Movie Mode : hr:min:sec format

Post by rednoah »

What have you tried so far? Where are you stuck? Please include screenshots so that we can see what you see.
:idea: Please read the FAQ and How to Request Help.
RBCC
Posts: 118
Joined: 17 May 2016, 02:23

Re: Movie Mode : hr:min:sec format

Post by RBCC »

Code: Select all

{def characters=["Mickey"," Minnie"," Donald" ,"Daisy"]} {assert characters instance of List}
?How do I use them in my

Code: Select all

{"Main Charcter∶ " } {character.??? }
Please rewrite if necessary! Thank you John
User avatar
rednoah
The Source
Posts: 20924
Joined: 16 Nov 2011, 08:59

Re: Movie Mode : hr:min:sec format

Post by rednoah »

What does the code you wrote try to do? The list is correct, but it's unclear what you're trying to do with that list.
:idea: Please read the FAQ and How to Request Help.
kim
Power User
Posts: 1236
Joined: 15 May 2014, 16:17

Re: Movie Mode : hr:min:sec format

Post by kim »

Code: Select all

{def characters=["Mickey"," Minnie"," Donald" ,"Daisy"]; characters instanceof List}
stop this and use a CSV file like rednoah wrote back in 2018
viewtopic.php?p=36619#p36619

viewtopic.php?p=56089#p56089
viewtopic.php?p=40459#p40459

maybe you can use this ?

Code: Select all

{ def Character = net.filebot.WebServices.TheTVDB.getActors(series.id, Locale.ENGLISH).character.findAll{it}.collect{it.split('/')*.replaceAll(/\s\(.*\)|\sand/, '')*.trim()*.tokenize(',')}.flatten().unique();
Character.take(4)
}
sample:

Code: Select all

[Daisy Duck, Huey, Dewey, Louie]
or

Code: Select all

[Daffy Duck, Bugs Bunny, Porky Pig, Speedy Gonzales]
I don't know why there is not builtin way of doing this ?
RBCC
Posts: 118
Joined: 17 May 2016, 02:23

Re: Movie Mode : hr:min:sec format

Post by RBCC »

What does the code you wrote try to do? The list is correct, but it's unclear what you're trying to do with that list
I am trying to use it in renaming files with filebot(in Gui).such as
{"character :") ( character. name[1] } for Mickey Mouse. DO i have to define the List first?
kim
Power User
Posts: 1236
Joined: 15 May 2014, 16:17

Re: Movie Mode : hr:min:sec format

Post by kim »

Don't write "code", but tell us the END RESULT you want and a sample show to test with.

Code: Select all

{"character :") ( character.name[1] } 
?

Code: Select all

{character.name[1]}
=
No such property: character for class
=
bad code

This does like above but work:

Code: Select all

{ def Character = net.filebot.WebServices.TheTVDB.getActors(series.id, Locale.ENGLISH).character.findAll{it}.collect{it.split('/')*.replaceAll(/\s\(.*\)|\sand/, '')*.trim()*.tokenize(',')}.flatten().unique();
'character: ' + Character[0]
}
you want "show" to = same characters in the way you want every time then use a CSV file like rednoah wrote back in 2018
viewtopic.php?p=36619#p36619
4. Mappings from a CSV file

Code: Select all

{ csv('/path/to/names.csv').get(n) ?: n }
something IN and output what you want
User avatar
rednoah
The Source
Posts: 20924
Joined: 16 Nov 2011, 08:59

Re: Movie Mode : hr:min:sec format

Post by rednoah »

Creating a list, and then taking the first element from that list would look like this:

Code: Select all

{
	def characters = ["Mickey", "Minnie", "Donald", "Daisy"]
	characters[0]
}
The code above, if used as is, not useful, since it's just gonna yield the same constant value, thus functionally equivalent to just writing the value without any code at all:

Code: Select all

Mickey

:arrow: Presumably, you want to retrieve the names of characters from your selected database. This may or may not be supported depending on your chosen database.



For TheMovieDB / Movie Mode this will work:

Code: Select all

{ info.cast[0].character }
e.g.

Code: Select all

$ filebot -list --db TheMovieDB --q 19995 --format "{ info.cast[0].character }"
Jake Sully


If you want the same for episodes, then that is less well supported, and may or may not work for the individual episode from the chosen database, on a case-by-base basis:

Code: Select all

{ episode.info.cast[0].character }
e.g.

Code: Select all

$ filebot -list --db TheMovieDB::TV --q 01437 --format "{episode} => { episode.info.cast[0].character }"
Firefly - 1x01 - The Train Job => Lund
Firefly - 1x02 - Bushwhacked => Commander Harken
Firefly - 1x03 - Our Mrs. Reynolds =>
Firefly - 1x04 - Jaynestown => Magistrate Higgins
...
:idea: Please read the FAQ and How to Request Help.
Post Reply