INTERACT FORUM

Please login or register.

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

Author Topic: MCC_MOVE_COPY_FIELDS via command line  (Read 931 times)

locust

  • Citizen of the Universe
  • *****
  • Posts: 699
MCC_MOVE_COPY_FIELDS via command line
« on: December 17, 2012, 06:18:40 pm »

HOWTO: Generate album ratings using variables (+ track count)

After using this wonderful code, I opted to using it to create my album rating panes, the only problem was that I would have to invoke the var_rating smartlist before the panes would populate. So I popped the following code into a user field and created another rating field, so that I could periodically copy the auto generated album ratings over to the one that stores permanently and which is now the field that my panes are based upon..

if(compare(load(v_albumratingsum[album artist (auto)][album]),>,0),formatnumber(math( load(v_albumratingsum[album artist (auto)][album]) / load(v_tracks[album artist (auto)][album]) ),2),0)

I was looking at the scheduler, and saw that you can use the command line, can I use the core command MCC_MOVE_COPY_FIELDS to copy the auto generated field to the permanent one? The command has no parameters on the wiki and I am a little apprehensive of blindly trying it in case I screw something up..

Thanks
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: MCC_MOVE_COPY_FIELDS via command line
« Reply #1 on: December 17, 2012, 06:38:09 pm »

I believe that MCC will work on the selection, so it is not what you want.

You don't need to use a smartlist to have the ratings updated.  You can enter part 1 of the 2 expressions into the Set rules for file display section of the view.  This will force the variables to be updated as soon as the view is invoked.
Logged
The opinions I express represent my own folly.

locust

  • Citizen of the Universe
  • *****
  • Posts: 699
Re: MCC_MOVE_COPY_FIELDS via command line
« Reply #2 on: December 17, 2012, 06:43:20 pm »

Never knew that, thanks..
Do you mean this part?

[Media Type]=[Audio] [=save(0,v_tracks[album artist (auto)][album])1]=1 [=save(math(1+load(v_tracks[album artist (auto)][album])),v_tracks[album artist (auto)][album])1]=1 [=save(0,v_albumratingsum[album artist (auto)][album])1]=1 [=if(compare([rating],=,0),save(-1,v_albumratingsum[album artist (auto)][album]),)1]=1 [=if(compare(load(v_albumratingsum[album artist (auto)][album]),>,-1),save(math([rating]+load(v_albumratingsum[album artist (auto)][album])),v_albumratingsum[album artist (auto)][album]),)1]=1 ~sort=[Album Artist (auto)],[Album],[Track #],[Media Type],[Disc #],[Name]
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: MCC_MOVE_COPY_FIELDS via command line
« Reply #3 on: December 17, 2012, 06:58:51 pm »

Right.  That is just a humongous expression, expressed in the form of a query.  Paste it into a view's Import/Export button under Set rules for file display.
Logged
The opinions I express represent my own folly.
Pages: [1]   Go Up