Sort by Language

Any questions? Need some help?
Post Reply
Zerelah
Posts: 23
Joined: 18 Feb 2014, 16:22

Sort by Language

Post by Zerelah »

Hi again
I have been tried all nite to find a way to Identify the Language in the video file, have tried most or snippets of code I could find here on the site but I keep getting binding error or Language Unknow. I would like to sort danish movies to their own folder, Ive tried using {country} to and getting binding error undefined
this is the code im working with

Code: Select all

{genres.contains('Animation') ? 'Cartoons' {sort danish movies here}:{n.sortName()[0].match((~/(?i)[0-9]/):'0-9',(~/(?i)[a-d]/):'ABCD',(~/(?i)[e-h]/):'EFGH',(~/(?i)[i-l]/):'IJKL',(~/(?i)[m-p]/):'MNOP',(~/(?i)[q-t]/):'QRST') ?: 'UVWYXZ'}/{n} {y}
I am sorry for the many post so plz know posting is not my first solution it is in fact my last I have been sitting here 8 hours trying to figure this out looking through every post and every link, so hope there is help yet again

p.s
what is the correct way of doing this

Code: Select all

{genres.contains('Science Fiction') ? 'Sci-Fi' : genres[9]}
User avatar
rednoah
The Source
Posts: 22986
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Sort by Language

Post by rednoah »

1. Not possible for .avi files, but for .mkv and similar container formats this will work:

Code: Select all

{media.AudioLanguageList}
2. I don't know what you want, but genres[9] doesn't make sense. That translates to "just take the 10th Genre" and will naturally fail for media belonging to less then 10 genres, most likely that includes anything ever. Use genres[0] since there will be at least one right?
:idea: Please read the FAQ and How to Request Help.
Zerelah
Posts: 23
Joined: 18 Feb 2014, 16:22

Re: Sort by Language

Post by Zerelah »

Hi rednoah
tx for the reply
I hope you check back here I found some weird stuff in the meantime
well this was just an example to play with but that was why i used 9 because it dident output anything what i wanted was genre contians ('Science Fiction') ? 'Sci-Fi' else do nothing I tried the : as a null I found over at the groovy site you link to but i couldent get it to work.

On a side side note
I have noticed that some downloads come with DC as directors cut if I ad dc to the fn match and then add the replace dc to directors cut I end up with directors cut directors cut


this is the code

Code: Select all

{n.sortName()[0].match((~/(?i)[0-9]/):'0-9',(~/(?i)[a-d]/):'ABCD',(~/(?i)[e-h]/):'EFGH',(~/(?i)[i-l]/):'IJKL',(~/(?i)[m-p]/):'MNOP',(~/(?i)[q-t]/):'QRST') ?: 'UVWYXZ'}/{n.replaceFirst(/^(?i)(The)\s(.+)/, /$2, $1/)} ({y}){' [' + file.path.matchAll(/extended|uncensored|remastered|unrated|uncut|3d|dc|director.*cut|special.edition/)*.upperInitial()*.lowerTrail().sort().unique().join(', ').replaceAll(/[Dc]/, "Directors cut").replaceAll(/[._]/, " ") + ']'} /{n} ({y}) {"CD$pi"}{' [' + file.path.matchAll(/extended|uncensored|remastered|unrated|uncut|3d|director.*cut|special.edition/)*.upperInitial()*.lowerTrail().sort().unique().join(', ').replaceAll(/[._]/, " ") + ']'} {[c{source} ?: 'BDrip']}{"."+lang.getDisplayName(Locale.getDefault()).upperInitial()}
Image

axxo raleases create a shitload of subfolders
Image
Post Reply