INTERACT FORUM

Please login or register.

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

Author Topic: Automatically sync Folder (device) every 30 minutes?  (Read 5175 times)

benn600

  • Citizen of the Universe
  • *****
  • Posts: 3849
  • Living: Santa Monica CA Hometown: Cedar Rapids IA
Automatically sync Folder (device) every 30 minutes?
« on: November 06, 2013, 03:41:48 am »

Is there an easy way to force Media Center to automatically synchronize my folder of media every 30 minutes or by another interval?  I use Library Server almost exclusively and I have a folder of songs that I want added to my iPhone.  These synchronize to a Dropbox folder.  When I am on my personal Mac, I just have to drag the folder into iTunes for it to update, followed by a wireless WiFi sync.

If I could have Media Center automatically sync, the delay of conversion and uploading to Dropbox would be almost skipped.  All I would have to do is drag in the folder and hit sync, both take under a minute combined.

Automatic syncing?  Via task scheduler or another means?
Logged

InflatableMouse

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 3978
Re: Automatically sync Folder (device) every 30 minutes?
« Reply #1 on: November 06, 2013, 04:40:25 am »

Have a look at GoodSync, AllWaySync, SyncTool. These all do what you want and some have crossplatform applications.
Logged

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: Automatically sync Folder (device) every 30 minutes?
« Reply #2 on: November 06, 2013, 06:45:22 am »

Have a look at GoodSync, AllWaySync, SyncTool. These all do what you want and some have crossplatform applications.

I think he wants to use MC's Handheld Sync automatically.  Is that so, Ben?  There is a way, but it isn't exactly pretty.

Dropbox would handle the part you were talking about, InflatableMouse.
Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/

rlebrette

  • Guest
Re: Automatically sync Folder (device) every 30 minutes?
« Reply #3 on: November 06, 2013, 07:09:04 am »

Using the JRiver' windows automation commands, this should be easily automated.
Just create a batch file that will run the command 23015 (I think it's the right one)
All commands are available here: http://wiki.jriver.com/index.php/Media_Center_Core_Commands

Something like:

MC19.exe /MCC 23015,<id>

Where id is the id of the device.
Logged

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: Automatically sync Folder (device) every 30 minutes?
« Reply #4 on: November 06, 2013, 09:00:06 am »

MC19.exe /MCC 23015,<id>

Where id is the id of the device.

And therein lies the rub.

There is no simple way (at all) to get the nDeviceSessionID for each individual handheld.  So, there is no way to automate the sync of a particular handheld.  I've been beating this drum for a few years now:

There's no simple way to get a session ID for a specific device.  But if you use zero, it'll use the default device.

So, you can't automate the sync of a particular named Handheld device from the list in MC.  But you CAN automate the sync of first, and only first, device that happens to show up in MC's list of Handhelds.

I can post a specific script I use later if you'd like, but basically you can run:

mc19.exe /MCC 23015,0

And it'll sync the first device you have in the list.  If you can figure out a way to divine the other nDeviceSessionIDs (and they don't change from run to run) then please let me know.

The other thing I'm not sure about is whether this sync actually rebuilds the Handheld Sync list at each run.  I haven't done enough testing to be sure, but I suspect that it might not actually rebuild it if MC has otherwise not been used (so the source Smartlists haven't been refreshed by MC's GUI) between automated runs.

I only have my sync run once a day, so this isn't a massive issue for me.  If you were going to run it every 30 min, it might not work as well.
Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: Automatically sync Folder (device) every 30 minutes?
« Reply #5 on: November 06, 2013, 09:02:17 am »

Obligatory begging for Matt:

Been over a year.  Any change?  I need to do three different ones on a schedule.  How can I get the nDeviceSessionID?

Been another year and a half.  Can we get a command to (refresh the Handheld queue and) sync a named device in automated fashion?  Something like:

mc19.exe /HandheldSync "My Device"

KThnxBye!
Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: Automatically sync Folder (device) every 30 minutes?
« Reply #6 on: November 06, 2013, 09:06:26 am »

Lastly, Ben... Once you get MC to sync to your Dropbox folder, there is absolutely no need to manually add the files that show up into iTunes on the Mac.  I present to you, Hazel:

http://www.noodlesoft.com/hazel.php

Quote
Hazel watches whatever folders you tell it to, automatically organizing your files according to the rules you create. It features a rule interface similar to that of Apple Mail so you should feel right at home. Have Hazel move files around based on name, date, type, what site/email address it came from (Safari and Mail only) and much more. Automatically put your music in your Music folder, movies in Movies. Keep your downloads off the desktop and put them where they are supposed to be.



There's a trial, but honestly...  It is $28.  Just buy it.  You won't regret it.  I seriously couldn't live without Hazel on my Macs.
Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42029
  • Shoes gone again!
Re: Automatically sync Folder (device) every 30 minutes?
« Reply #7 on: November 06, 2013, 09:41:16 am »

Obligatory begging for Matt:

Been another year and a half.  Can we get a command to (refresh the Handheld queue and) sync a named device in automated fashion?  Something like:

mc19.exe /HandheldSync "My Device"

KThnxBye!

How about we add a web service function like:
MCWS/v1/Handheld/Sync?Device=My Device&DeviceType=Name&ShowWarnings=1

You could also call it from the command line or COM.
Logged
Matt Ashland, JRiver Media Center

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: Automatically sync Folder (device) every 30 minutes?
« Reply #8 on: November 06, 2013, 09:45:28 am »

Sold!!
Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42029
  • Shoes gone again!
Re: Automatically sync Folder (device) every 30 minutes?
« Reply #9 on: November 06, 2013, 09:46:30 am »

Sold!!

If it's not done in a few days, please bump this thread.
Logged
Matt Ashland, JRiver Media Center

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: Automatically sync Folder (device) every 30 minutes?
« Reply #10 on: November 06, 2013, 09:49:15 am »

Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/

benn600

  • Citizen of the Universe
  • *****
  • Posts: 3849
  • Living: Santa Monica CA Hometown: Cedar Rapids IA
Re: Automatically sync Folder (device) every 30 minutes?
« Reply #11 on: November 06, 2013, 10:06:55 am »

This is all sounding great.  Yes, I want Media Center to automatically trigger a synchronize.

1. I use Media Center client 100% -- I still have to hit the server once in a while but hopefully these stop being needed (playlists never delete, playlist headers don't save)
2. I have an "iPhone" folder with: "Christmas Suggestions" and "Normal Suggestions" as well as "Add to iPhone."  The suggestions are highly rated songs that are NOT in my "Add to iPhone" folder, so I add songs that I want (from these special playlists or anywhere really) and then they disappear so I don't keep adding them.
3. Media Center synchronizes this as a fake handheld to Dropbox/Media Center with [Artist] as the layout.  This I want to automated.  I can add files to my "Add to iPhone" playlist from the client (home or work) and I'd like the media to automatically export periodically so it's in Dropbox and ready when I get home.
4. Drag Media Center to iTunes, hit sync on my two phones (via WiFi).  Perfect.  The only uncertainty is song deletions, which I don't think iTunes finds and triggers.
Logged

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42029
  • Shoes gone again!
Re: Automatically sync Folder (device) every 30 minutes?
« Reply #12 on: November 06, 2013, 01:58:26 pm »

Next build:
SDK: Added MCWS/v1/Handheld/Sync to the web service.

I had to do a little work to allow this new function to run on the main thread.  Previously all functions ran on the request thread (ie. a different thread for each request / response).  From this came:
Faster: Improved the concurrency of MCWS (previously calling the same function multiple times at once would cause the calls to take turns).
SDK: MCWS/v1/Control/MCC can optionally wait for the command to finish before returning by setting Block=1.
Logged
Matt Ashland, JRiver Media Center

benn600

  • Citizen of the Universe
  • *****
  • Posts: 3849
  • Living: Santa Monica CA Hometown: Cedar Rapids IA
Re: Automatically sync Folder (device) every 30 minutes?
« Reply #13 on: November 06, 2013, 02:54:23 pm »

Spectacular!  Does anyone have a recommendation on running this on a schedule?  Task Scheduler or another approach in Windows?  I hope this re-checks the device, too, as the playlist of songs will likely have changed from time to time.

Mac experts: recommendation for having iTunes automatically import my "Dropbox/Media Center" folder on a schedule and trigger a sync of both of my iPhones periodically?  Are either of these possible?  Then it would be fully automated as long as I go home and turn my computer on!
Logged

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: Automatically sync Folder (device) every 30 minutes?
« Reply #14 on: November 07, 2013, 08:06:13 am »

Mac experts: recommendation for having iTunes automatically import my "Dropbox/Media Center" folder on a schedule and trigger a sync of both of my iPhones periodically?  Are either of these possible?  Then it would be fully automated as long as I go home and turn my computer on!

I already addressed that: Hazel.

It is even better than that, actually.  It can, much like Dropbox (and MC's Auto-Import), detect filesystem changes, so it doesn't have to run on a schedule, it can just trigger whenever the contents of a monitored location change.  Or you can schedule it if you'd like (or both).
Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/

benn600

  • Citizen of the Universe
  • *****
  • Posts: 3849
  • Living: Santa Monica CA Hometown: Cedar Rapids IA
Re: Automatically sync Folder (device) every 30 minutes?
« Reply #15 on: November 07, 2013, 12:11:28 pm »

Does Hazel copy files into the "Add Automatically" folder that iTunes has?  I don't understand how its abilities help me.  Will it trigger an import into iTunes?
Logged

benn600

  • Citizen of the Universe
  • *****
  • Posts: 3849
  • Living: Santa Monica CA Hometown: Cedar Rapids IA
Re: Automatically sync Folder (device) every 30 minutes?
« Reply #16 on: February 17, 2014, 11:27:31 am »

The new service works great with one caveat.  It doesn't trigger a recheck sync.  My device always shows up as up-to-date and it doesn't sync.  Could an input parameter be added to enforce a recheck prior to synchronization?

SDK: Added MCWS/v1/Handheld/Sync to the web service.
Logged

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: Automatically sync Folder (device) every 30 minutes?
« Reply #17 on: April 15, 2015, 11:50:27 pm »

Long distance bump on this.

I'd like to get this to work, but it doesn't.  My "iTunes" handheld takes a long time to prepare to sync.  It is usually 2-4 minutes before the sync list fills when I go to that item under Drives & Devices. This is because of the set of playlists it uses to generate the sync list, and the size of the sync itself (which is 44k files, most of which are always already synced), I believe.  Either way, it takes forever.

I finally got around to tweaking my system tonight.  I'd been using the old MCC way that takes nDeviceSessionID as the argument, which doesn't work well because I can't know what the nDeviceSessionID is, so I have to keep the iTunes item as my only sync device (and send nDeviceSessionID=0).  But I want to add a second one to MC for another purpose, but I can't because this breaks my auto-syncing script.

So, I finally got around to using this, but it doesn't work with my sync list.

First of all, I absolutely need it to refresh the list.  Benn indicated above that this doesn't happen, so that wouldn't be useful.  However, I can't even get that far.  Every time I try to use it, it gives me the error that: "Device iTunes is not ready."  The only way I can get it to work is if I first manually open Drives & Devices > iTunes and wait the 2-4 minutes for it to update the list.  Then, and only then, does the command work.  Otherwise, I get the error.

Can we make this cool thing you made for us useful?
Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/

benn600

  • Citizen of the Universe
  • *****
  • Posts: 3849
  • Living: Santa Monica CA Hometown: Cedar Rapids IA
Re: Automatically sync Folder (device) every 30 minutes?
« Reply #18 on: April 16, 2015, 01:04:08 pm »

What an old topic! I'm so far removed from this topic now as I use multiple Synology DiskStations and their 9 iOS/Android apps for all my media on my desktop/tablet/mobile devices.
Logged

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: Automatically sync Folder (device) every 30 minutes?
« Reply #19 on: May 02, 2015, 12:49:07 am »

Any love on this?

I'm using:
http://localhost:PORT/MCWS/v1/Handheld/Sync?Device=iTunes&DeviceType=Name&ShowWarnings=1

It always responds:


To get it to sync using this command, I have to manually open the item in the Tree and wait for it to process the list.  This makes it essentially useless for automation, obviously.
Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/
Pages: [1]   Go Up