INTERACT FORUM

Please login or register.

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

Author Topic: Incrementing NumberPlays Field with Sync  (Read 5577 times)

eCo

  • Recent member
  • *
  • Posts: 22
Incrementing NumberPlays Field with Sync
« on: January 09, 2016, 02:00:36 pm »

Hi,

I use a smartlist to sync to my handheld and I'd like MC to increment the transferred tracks' NumberPlays field each time the device is synced.  I could then improve my smartlist to preferentially load less-played tracks (these days I'm listening to music more in my car than at home, so plays within MC are now infrequent).

I've studied the expression language, but I can only deduce manual ways to do this.  Is there an expression I can add to the smartlist that performs 'NumberPlays = NumberPlays + 1' for all the tracks in the list?  ?

Thanks!
Logged

eCo

  • Recent member
  • *
  • Posts: 22
Re: Incrementing NumberPlays Field with Sync
« Reply #1 on: January 11, 2016, 02:10:07 pm »

Anybody??
Logged

Arindelle

  • Citizen of the Universe
  • *****
  • Posts: 2772
Re: Incrementing NumberPlays Field with Sync
« Reply #2 on: January 12, 2016, 05:57:22 am »

Simple answer ... no.

But really it's more like "I don't think so." 

if you are trying to sync actual playcounts, how will JRiver know how many times you have listened to track X in your car? -- supposing that you are not playing back via JRiver but from a handheld right?) so adding a +1 in JRiver field if you could figure out the expression would just increment by +1 -- if you listened to something three times or 0 times it would be wrong. You are syncing playlist not actual files ... so your player would have to write the playback information to the file and then JRiver would have to reimport it. (and not just keep the play stats in a db like itunes does)

Maybe you could use JRemote and externally stream your files -- but that would require internet etc. as the Remotes do not at this time support local (ie portable device) playback.

If you just want to increment the number of times it has been synced, maybe you could do that using a custom field, but not sure I see the point in that .. maybe I'm not following what you are trying to do.
Logged

eCo

  • Recent member
  • *
  • Posts: 22
Re: Incrementing NumberPlays Field with Sync
« Reply #3 on: January 12, 2016, 01:11:57 pm »

Quote
If you just want to increment the number of times it has been synced, maybe you could do that using a custom field

This would work.  How do I do that?  I've made custom fields for other reasons, so I know that part.  I'm just not clear on how to increment a field for a list of tracks.

The point of this exercise is that I have a lot more music than I put on my phone at any one time.  But even tho I load it with random (and shuffled) albums each time, it seems I get to get a lot of repeats.  This may simply be a probability issue, but nevertheless, I'd like to try to cut down on those repeats.

Thanks for your reply!
Logged

gappie

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4580
Re: Incrementing NumberPlays Field with Sync
« Reply #4 on: January 13, 2016, 04:55:14 am »

im still not totally sure what you want.
but maybe this is what you are after.
when you are in the playlist and you want to increment number plays you could select them all and paste this in the numberplays column
Code: [Select]
=Math([number plays,0]+1)just try 1 first ofcource..

 :)
gab

edit: btw, when you think its to much typing everytime, you could make a custom field with the expression in it, and call it np1. then you could just use
=[np1]
on the number plays column
Logged

Arindelle

  • Citizen of the Universe
  • *****
  • Posts: 2772
Re: Incrementing NumberPlays Field with Sync
« Reply #5 on: January 13, 2016, 05:02:51 am »

oops gappie posted the answer for an expression column at the same time .. well I already typed it so what the heck  ;)

well you could set up a new calculated field using the Math(...) function

eg using Number of plays the expression would be

Code: [Select]
=math([Number Plays]+1)

this would automatically add 1 to the play count. ([Number Plays] is an integer type field)

or from a list you could manually type the expression in one field based on the other.


PS - you might need to create a second custom field say like "Sync Count" -- select all the tracks and add 1 to it (it should be an integer field for the math to work so it fills out the new custom field).  And set up a smartlist to spit out x files with the lowest "Sync Counts". After sync you could type the expression in its own field tag box  (something like =math([Sync Count]+1). To fully automate it probably would need 2 custom fields (one that holds the total syncs and one that you type 1 in after sync? You'll have to think that one through to see what is best for you


EDIT : believe expression should be =Math(FormatNumber([Number Plays])+1) SEE below sorry for the confusion
Logged

gappie

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4580
Re: Incrementing NumberPlays Field with Sync
« Reply #6 on: January 13, 2016, 05:07:02 am »

:) im sorry :)
just one note arindelle.. it schould be
=math([Number Plays,0]+1)
without the ,0 the expression does not work on number plays =0

 :)
gab
Logged

Arindelle

  • Citizen of the Universe
  • *****
  • Posts: 2772
Re: Incrementing NumberPlays Field with Sync
« Reply #7 on: January 13, 2016, 05:23:34 am »

:) im sorry :)
just one note arindelle.. it schould be
=math([Number Plays,0]+1)
without the ,0 the expression does not work on number plays =0

 :)
gab
hmm interesting .. for the expression in a column ? didn't try that

for creating a new field it seems to works though

screenshot of field called 1erase with track having 1 in Number Plays (EDIT: see below expression should be =Math(FormatNumber([Number Plays])+1)
?



Logged

Arindelle

  • Citizen of the Universe
  • *****
  • Posts: 2772
Re: Incrementing NumberPlays Field with Sync
« Reply #8 on: January 13, 2016, 06:28:59 am »

Not an expert in expression language  :) !!! I see what you are getting to Gappie. The empty Number of plays will not increment from NULL.

referring to this post http://yabb.jriver.com/interact/index.php?topic=58110.msg393706#msg393706

I tried using the ,0 in an expression column and empty fields do not increment empty (NULL) fields either

so although it will work IF the field is not empty this is the expression for the OP to use I guess

Code: [Select]
=Math(FormatNumber([Number Plays])+1)
here is a test for all 3


Logged

gappie

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4580
Re: Incrementing NumberPlays Field with Sync
« Reply #9 on: January 13, 2016, 06:47:35 am »

that is interesting arindelle, that was an old discussion you where referring too, i forgot all about that.. and indeed your method is the surest way, although in my database
math([number plays,0])
already put a 0 there. apparently NULL values are still a bit hard to handle.. :) so yours is indeed the best solution.

ps, for the op, to explain the ,0... when added to a database field, it will give you the value as it is stored in the database of mc. this can look very different from the value you get without the ,0 (try date imported or something like that as a example)

 :)
gab
Logged

Arindelle

  • Citizen of the Universe
  • *****
  • Posts: 2772
Re: Incrementing NumberPlays Field with Sync
« Reply #10 on: January 13, 2016, 06:57:15 am »


ps, for the op, to explain the ,0... when added to a database field, it will give you the value as it is stored in the database of mc. this can look very different from the value you get without the ,0 (try date imported or something like that as a example)

 :)
gab
I checked some of my expressions and I was having problems with date imported! The ,0 fixes it. Thanks Gab! :)
Logged

eCo

  • Recent member
  • *
  • Posts: 22
Re: Incrementing NumberPlays Field with Sync
« Reply #11 on: January 14, 2016, 08:21:14 pm »

Thanks guys, that sounds perfect.  And I'm doubly grateful that I'm not going to have to work out the dreaded 'null' set pitfall!  8)

But just to be clear, this will work for a smartlist, yeah?  I'll set this as the last expression for a complex list of albums, and those will all get popped, right?  I won't be able to test until this weekend.

-C
Logged

Arindelle

  • Citizen of the Universe
  • *****
  • Posts: 2772
Re: Incrementing NumberPlays Field with Sync
« Reply #12 on: January 15, 2016, 03:28:23 am »

You're welcome! sure it will work for a smartlist. A SL is just a simplified view anyway, really.

You might want to consider this as a View, it could give you more filtering possibilities for maintaining it I think. Like Gappie said in his edit with the example =[NP1]. You could set up a pane view and filter by sync number, if unassigned you could just select and type in once like he indicated.

I have a lot of admin type Views and I just separate them by Creating another root in the Tree
Logged

blgentry

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 8014
Re: Incrementing NumberPlays Field with Sync
« Reply #13 on: January 15, 2016, 07:39:01 am »

The key point here is that this adding 1 to the play count is NOT going to happen automatically on sync.  You'll need to cut and paste into the number plays field in order to increment the count.

Brian.
Logged

Arindelle

  • Citizen of the Universe
  • *****
  • Posts: 2772
Re: Incrementing NumberPlays Field with Sync
« Reply #14 on: January 15, 2016, 09:47:43 am »

The key point here is that this adding 1 to the play count is NOT going to happen automatically on sync.  You'll need to cut and paste into the number plays field in order to increment the count.

Brian.
yes, you have to do something, but it should be pretty simple. He has to select the files for sync anyways.

you could do what I believe gappie is suggesting with =[NP] or whatever the custom field is named, couldn't you. This could be based on number plays at first but afterwards it would be more or less a sync counter. To upgrade the list, if [Number of Syncs]  is the custom field; select tracks to sync and type the formula in once, adding a 1. Of course Brian is right you would have to add 1 to the selected files, but it always would be the same at least. Why a view with another expression field would be nice, and would make the selection easy too. USing 2 custom fields might be better  though. Like 1 math field like [Sync+1];  and another integer field like [SyncCount]. Then all you need to do is type, after selecting the files for sync, =[Sync+1] in the SyncCount field .. or would that loop? I don't think so but I haven't tested it with integer fields ... it works in string txt fields though.
Logged
Pages: [1]   Go Up