Sort Sylvester Stallone movies

Any questions? Need some help?
Post Reply
Optimus
Posts: 13
Joined: 15 Apr 2019, 00:56

Sort Sylvester Stallone movies

Post by Optimus » 21 Jul 2019, 14:27

Hello,

Please if someone can assist me, I'll be very grateful.

I have some video clips of various actors and I'm sorting to them in order.

I have some files named like this "Rocky 2_final fight_Sylvester Stallone". I intend to sort them by re-naming them the file to the actor the film is associated with followed by a digit to denote the number of files. For example:

- Sylvester Stallone 1
- Sylvester Stallone 2
- Sylvester Stallone 3

What code would I enter to make this happen? This might be forward, but I don't prefer to learn coding, so I can get to better grips with the FileBot. I purchased it to sort a few files and then more than likely I won't be using it.

If someone can assist me with the code, that'll be great.

User avatar
rednoah
The Source
Posts: 16283
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Sort Sylvester Stallone movies

Post by rednoah » 21 Jul 2019, 15:06

:idea: Your requirements are odd and unique, and thus may or may not be supported well out of the box. I recommend sticking to built-in bindings such as {plex} to keep things simple.


1.
Maybe something like this is close enough to what you want:

Code: Select all

{ny} with {actors.take(2)}

2.
Grouping and numbering by first actor is a bit more tricky:

Code: Select all

{ny} - {actors[0]} {model.findAll{ actors[0] in it.actors }.findIndexOf{ id == it.id } + 1}
:arrow: viewtopic.php?f=5&t=5690
:idea: Please read the FAQ and How to Request Help.

Optimus
Posts: 13
Joined: 15 Apr 2019, 00:56

Re: Sort Sylvester Stallone movies

Post by Optimus » 21 Jul 2019, 15:20

Hi rednoah,

Thank you.

Would I replace "actors" in each of the codes with the name of the actor? So for example:

{ny} with {Sylvester Stallone.take(2)}

{ny} - {Sylvester Stallone[0]} {model.findAll{ Sylvester Stallone[0] in it.Sylvester Stallone}.findIndexOf{ id == it.id } + 1}


Plus, would I run the first code and then the second?

I appreciate your effort mate.

User avatar
rednoah
The Source
Posts: 16283
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Sort Sylvester Stallone movies

Post by rednoah » 21 Jul 2019, 15:26

No. Why would you do that?

{actors} is a variable that will give the actors for the movie match, so the value is different for each movie.
:idea: Please read the FAQ and How to Request Help.

Optimus
Posts: 13
Joined: 15 Apr 2019, 00:56

Re: Sort Sylvester Stallone movies

Post by Optimus » 21 Jul 2019, 15:29

Pardon my ignorance. I'm clueless when it comes to executing codes.

Understood.

Would I run the first code and then the second?

User avatar
rednoah
The Source
Posts: 16283
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Sort Sylvester Stallone movies

Post by rednoah » 21 Jul 2019, 15:29

Both format expressions given above are independent of each other. Just two possible solutions to your naming problem.

You may need to familiarize yourself with FileBot formats first though.
:idea: Please read the FAQ and How to Request Help.

Optimus
Posts: 13
Joined: 15 Apr 2019, 00:56

Re: Sort Sylvester Stallone movies

Post by Optimus » 21 Jul 2019, 15:41

I was just wondering how the code would know which word in the original file name would be the actor.

User avatar
rednoah
The Source
Posts: 16283
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Sort Sylvester Stallone movies

Post by rednoah » 21 Jul 2019, 15:45

Typically, FileBot works by identifying a movie from the filename, matching it to an online database, and then retrieve extra information such as actors or director from the internet on demand.
:idea: Please read the FAQ and How to Request Help.

Optimus
Posts: 13
Joined: 15 Apr 2019, 00:56

Re: Sort Sylvester Stallone movies

Post by Optimus » 21 Jul 2019, 16:04

rednoah wrote:
21 Jul 2019, 15:45
Typically, FileBot works by identifying a movie from the filename, matching it to an online database, and then retrieve extra information such as actors or director from the internet on demand.
Each time I Fetch Data there are too many mis-matchs. It only re-named 6 files out of 540.

Any suggestions?

User avatar
rednoah
The Source
Posts: 16283
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Sort Sylvester Stallone movies

Post by rednoah » 21 Jul 2019, 16:08

Screenshots and file paths please.

Read How to Request Help for details on how you can help me help you. ;)
:idea: Please read the FAQ and How to Request Help.

Optimus
Posts: 13
Joined: 15 Apr 2019, 00:56

Re: Sort Sylvester Stallone movies

Post by Optimus » 21 Jul 2019, 16:09

rednoah wrote:
21 Jul 2019, 16:08
Screenshots and file paths please.
To make things easier and if time permitting, I'm happy to give you remote access where you can see and get the job done?

Please.

User avatar
rednoah
The Source
Posts: 16283
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Sort Sylvester Stallone movies

Post by rednoah » 21 Jul 2019, 16:10

Sorry, remote assistance is not generally a service I provide.

Screenshots usually make it quite clear what you're trying to do. And file paths allow me to recreate your file structure for testing.
:idea: Please read the FAQ and How to Request Help.

kim
Power User
Posts: 777
Joined: 15 May 2014, 16:17

Re: Sort Sylvester Stallone movies

Post by kim » 21 Jul 2019, 22:14

He is asking about "video clips of various actors"
I think it's a bad idea to use normal online lookup here ?
the files can be named badly ?

if file e.g. "Rocky 2_final fight_Sylvester Stallone"
then use F2 aka offline mode
viewtopic.php?t=2072

with a format like this:
{fn.match(/Sylvester.Stallone|Some.other.dude/).space(' ')} {i}
for it to work you need to rename ALL of e.g. sly in 1 go

User avatar
rednoah
The Source
Posts: 16283
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Sort Sylvester Stallone movies

Post by rednoah » 22 Jul 2019, 03:18

I see. Possibly. Best to wait for screenshots and file paths and more details from the OP so we can check what the OP is talking about exactly.
:idea: Please read the FAQ and How to Request Help.

Post Reply