INTERACT FORUM

Please login or register.

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

Author Topic: Manually edit "last played" field?  (Read 2994 times)

wnshall2

  • Recent member
  • *
  • Posts: 19
Manually edit "last played" field?
« on: May 20, 2009, 04:36:41 pm »

Is it possible to manually edit the "last played" field?  It seems the "last played" field, like the "number plays" field can't be changed by typing in the box.  I tried following the hint in the wiki ( http://wiki.jrmediacenter.com/index.php/Changing_the_number_of_plays), but wasn't able to make it work.  I would enter a date like "5/10/2009" and the field would return something completely different (like "6/30/1969").  So I guess there are two questions here: can the hint from the wiki based on expressions be used for "last played", and if so, what is the correct format to manually enter dates? 
Logged

leezer3

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1569
Re: Manually edit "last played" field?
« Reply #1 on: May 20, 2009, 07:22:45 pm »

I think this thread should have what you're looking for in it:
http://yabb.jriver.com/interact/index.php?topic=43983.msg301174#msg301174

(Dates in MC are stored using a system that makes my head hurt  :D )

Cheers

-Leezer-
Logged

wnshall2

  • Recent member
  • *
  • Posts: 19
Re: Manually edit "last played" field?
« Reply #2 on: May 21, 2009, 01:40:49 am »

I think this thread should have what you're looking for in it:
http://yabb.jriver.com/interact/index.php?topic=43983.msg301174#msg301174

(Dates in MC are stored using a system that makes my head hurt  :D )

Thanks, that helps (although it makes my head hurt too.)  Does anyone have a nice expression
(or any other way to do it) that allows you to type in a "normal" date (MM/DD/YYYY) and have it converted to
the internal MC format?  I looked at the FormatDate expression but that doesn't look like it will do the job.
Logged

eba

  • Galactic Citizen
  • ****
  • Posts: 351
Re: Manually edit "last played" field?
« Reply #3 on: May 21, 2009, 05:47:26 am »

If you put a date - and time if you like, or you could use =NOW() - into Excel in cell A1 you can use this formula in another cell to work out the MC number:
Code: [Select]
=(A1-DATE(1970,1,1))*24*60*60-3600

wnshall2

  • Recent member
  • *
  • Posts: 19
Re: Manually edit "last played" field?
« Reply #4 on: May 21, 2009, 11:18:45 am »

If you put a date - and time if you like, or you could use =NOW() - into Excel in cell A1 you can use this formula in another cell to work out the MC number:
Code: [Select]
=(A1-DATE(1970,1,1))*24*60*60-3600

Right, but I was wondering if there is a way to do it in MC.  I'd just like to be able to have a field in MC in which I can enter a date and have MC understand it (eg. be able to replace the "last played" field with it, be able to use it as a date in smart playlists rules, etc.)  It looks like the answer is no, without writing some sort of script (in which you could do the necessary math), but I'd love to be shown to be wrong. 
Logged

eba

  • Galactic Citizen
  • ****
  • Posts: 351
Re: Manually edit "last played" field?
« Reply #5 on: May 21, 2009, 11:43:56 am »

Nope, don't think there's a way to do that at the moment unfortunately :(

prod

  • Citizen of the Universe
  • *****
  • Posts: 958
  • Play nice
Re: Manually edit "last played" field?
« Reply #6 on: May 21, 2009, 12:22:03 pm »

You can do this in javascript like so;

Code: [Select]
// Create MC object
var oMC = WScript.CreateObject("MediaJukebox Application");
// If successful
if(oMC != null)
{
    // Your filename
    var filename = "D:\Music\AC_DC\Back in Black\AC_DC - Back In Black.mp3";//Replace this with the filename of your track
    var oTrack = oMC.GetFile(filename);

    // If we've got the track   
    if(oTrack != null)
    {
        // Set your last played here
        var lastPlayed = 12345;//Replace this with seconds since midnight 01/01/1970
        // Set your play count here
        var playCounter = 1;//Replace this with your number of plays
       
        // Write the values
        oTrack.LastPlayed = lastPlayed;
        oTrack.PlayCounter = playCounter;
    }

    oTrack = null;
}

oMC = null;

Save this snippet with a .js file extension, edit it, double-click it and it should work. Not sure though I haven't tested it.
Logged

Sheugel

  • World Citizen
  • ***
  • Posts: 155
Re: Manually edit "last played" field?
« Reply #7 on: September 17, 2009, 01:13:32 pm »

Hi,
I would just like to make things clearer for newbies (like me).
- Go to a view where you see the files in list style
- Right click on the header of the columns and choose columns>add expression column
- In the expresion editor that pops up fill in by name: Change LP
- Fill in by expression: [last played]
- Select the file you want to change the number plays of, hold the mouse above the ‘change np’ from that file and hit F2
- Type in the number of seconds since 01/01/1970 00:00 till the date you want (eg: 08/01/2009 19:38 (GMT) = 1249155480  seconds)

To help you calculate the interval in seconds: http://www.timeanddate.com/date/duration.html
You can specify time.
Logged
Pages: [1]   Go Up