INTERACT FORUM

Please login or register.

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

Author Topic: In Development: Media Sync  (Read 5300 times)

scott_r

  • Regular Member
  • Galactic Citizen
  • ****
  • Posts: 306
In Development: Media Sync
« on: December 25, 2003, 05:46:54 am »

Hi all,

I'm currently writing a plugin that keeps your library up to date by monitoring changes in local and networked folders, and updating your library accordingly.
This plugin will only be able to run on Win2k/XP based machines, but according to a highly scientific poll I conducted earlier this week, this shouldn't be a problem.

There are a couple of things I need from the community before I can continue, though. First, I need to know how much support there would be for such a plugin. Second, due to current limitations of the SDK (noted below) some of the library operations that I want to be able to execute are not available - so I need support in getting these change requests heard by J River. Third, I need to know what functionality people would most like to see in a plugin of this type.

What it does now:
  • You can set up a list of "watch folders" which the plugin watches for changes.
  • Handles file creation by importing the new file silently.
  • Handles file renaming by changing the filename reference in the database record.
  • Handles file deletion however you have to confirm each file, because the SDK offers no way (that I know of) to remove files silently.
  • At the moment Media Sync can't handle move operations because they consist of two separate operations - a delete and a creation. The delete must be confirmed and the creation imports the new file, but the tag info stored in the file isn't imported into the database.
So what do you think? Good idea or bad? Suggestions?

Scott
Logged

Valissystem

  • Regular Member
  • World Citizen
  • ***
  • Posts: 158
  • Muso on ice...
Re:In Development: Media Sync
« Reply #1 on: December 25, 2003, 04:31:13 pm »

Hi there,

Yes, this could indeed be useful for me. I have a laptop for work and a home machine. Keeping stuff synchronised so that I have access to music in both places can be a pain.

 :)
Logged

sraymond

  • Guest
Re:In Development: Media Sync
« Reply #2 on: December 25, 2003, 04:46:30 pm »

Scott.,

I think this is a very important functionality and it would save me lots of time.  But I wonder if it isn't more appropriate for JRiver to implement this themselves?  There's a line between extensions/plugins and core functionality, though who knows where it lies?  I might get a little nervous about a plugin automatically (silently) and frequently interfacing with the database.

Users have been asking for a Watch Folders functionality for a very long time.  It's a great idea.  If JRiver has their focus elsewhere (because I'm sure they agree it's a useful feature) doing higher priority stuff, I say have at it!

Suggestions/Questions:  

1)  Can you set the plugin to run only when CPU utilization is low?  How about on a regular schedule?

2)  About importing tags, I'm not sure I understand the problem.  Are you saying that tags stored internally in a media file aren't added to the database?  That'd be strange.

Scott-
Logged

scott_r

  • Regular Member
  • Galactic Citizen
  • ****
  • Posts: 306
Re:In Development: Media Sync
« Reply #3 on: December 26, 2003, 01:09:57 am »

Quote
I wonder if it isn't more appropriate for JRiver to implement this themselves?
I agree. It is something that I would like to see at the core of Media Center, however it's a function that many people have asked for many times and I haven't heard of any plans for it's implementation. I'd like to hear from the guys what they think about it.

Quote
Can you set the plugin to run only when CPU utilization is low?  How about on a regular schedule?
The reason that the plugin will only work on Win2k/XP based machines is that when changes are made to the filesystem (under Win2k/XP) the operating system throws events that applications can catch. This means that the plugin won't be "scanning" for changes every few second/minutes/hours, but will be notified by Windows whenever a change occurs. This means that the plugin won't be thrashing your harddrive or taking up extra resources. Cool huh?

Quote
Are you saying that tags stored internally in a media file aren't added to the database?  That'd be strange.
Yes, it is. For the plugin to function correctly you would have to be storing info in the actual file tags, because when you move a file, it is actually made up of deleting the original and creating the new file. This means the plugin would have to remove the original entry from the database and then import the new file. When doing this manually through MC, the tags stored in the file are automatically added to the database, so your Artist, Album, etc, appear unchanged. However, when I try to import a file through the SDK the tags aren't imported, meaning you just get a bunch of files under the "Unassigned" view.

Scott.

Logged

sraymond

  • Guest
Re:In Development: Media Sync
« Reply #4 on: December 26, 2003, 01:27:04 am »

Quote
Can you set the plugin to run only when CPU utilization is low?  How about on a regular schedule?
The reason that the plugin will only work on Win2k/XP based machines is that when changes are made to the filesystem (under Win2k/XP) the operating system throws events that applications can catch. This means that the plugin won't be "scanning" for changes every few second/minutes/hours, but will be notified by Windows whenever a change occurs. This means that the plugin won't be thrashing your harddrive or taking up extra resources. Cool huh?

Definitely!

Quote
Are you saying that tags stored internally in a media file aren't added to the database?  That'd be strange.
Yes, it is. For the plugin to function correctly you would have to be storing info in the actual file tags, because when you move a file, it is actually made up of deleting the original and creating the new file. This means the plugin would have to remove the original entry from the database and then import the new file. When doing this manually through MC, the tags stored in the file are automatically added to the database, so your Artist, Album, etc, appear unchanged. However, when I try to import a file through the SDK the tags aren't imported, meaning you just get a bunch of files under the "Unassigned" view.

So it sounds like people that don't store tags internally (like me!) are out of luck?  You can't copy first and then delete?  How about creating an temporary MPL with the requisite tag information (including the new filename) and then importing the MPL?

I can't wait to see a beta...  if the speed with which you put together MCXMLExport is any indication, we won't have to wait long.

Scott-
Logged

scott_r

  • Regular Member
  • Galactic Citizen
  • ****
  • Posts: 306
Re:In Development: Media Sync
« Reply #5 on: December 26, 2003, 01:27:19 am »

Quote
Yes, this could indeed be useful for me. I have a laptop for work and a home machine. Keeping stuff synchronised so that I have access to music in both places can be a pain.
To clarify, Media Sync will be running in "real-time", which means that if you plug your laptop into your home network it won't synchronise your library. Instead it watches for changes to the file system as they are made so it won't pick up changes after they are made. Sorry. Maybe once this functionality is finished I will look into something that syncronises "offline" databases.

Scott.
Logged

scott_r

  • Regular Member
  • Galactic Citizen
  • ****
  • Posts: 306
Re:In Development: Media Sync
« Reply #6 on: December 26, 2003, 01:45:10 am »

Quote
How about creating an temporary MPL with the requisite tag information (including the new filename) and then importing the MPL?
I might play around with that idea. It depends on when Windows throws the event - before or after the delete has taken place.
Hrmm... may be complicated. But that sounds like fun, doesn't it?

Scott.
Logged

nila

  • Guest
Re:In Development: Media Sync
« Reply #7 on: December 27, 2003, 07:59:12 pm »

Quote
Yes, it is. For the plugin to function correctly you would have to be storing info in the actual file tags, because when you move a file, it is actually made up of deleting the original and creating the new file. This means the plugin would have to remove the original entry from the database and then import the new file. When doing this manually through MC, the tags stored in the file are automatically added to the database, so your Artist, Album, etc, appear unchanged. However, when I try to import a file through the SDK the tags aren't imported, meaning you just get a bunch of files under the "Unassigned" view.

Scott.

Scott - couldn't you simply change the 'filename' field of the original file in MC and not delete the original then re-import it?
If you changed the filename field this would automatically keep all the tag info?


I'm glad your making this plugin because I was considering doing it and you've saved me a lot of work.
For me personally though, as I dont have MC running all the time, I'd LOVE it if it'd also just have a standard 'scan folder for changes' type functionality.

This would be set to either run at a specific time of day or after X amount of idle time on the system or preferably both so I could set it to run at 2am every day when i was asleep but if I was still using the computer then it would detect it and not start until it was idle first for the X minutes.


Also, please remember to do a delayed start to the plugin of a few seconds (preferably around 5) so it doesn't start the instant MC loads otherwise it'll just lagg the load up even more ;D

Good luck with it though, cant wait to have it on my system!
Often forget to import files and end up getting like 5 or 6 albums imported together.
Logged

scott_r

  • Regular Member
  • Galactic Citizen
  • ****
  • Posts: 306
Re:In Development: Media Sync
« Reply #8 on: December 27, 2003, 11:33:47 pm »

Quote
Scott - couldn't you simply change the 'filename' field of the original file in MC and not delete the original then re-import it?
If you changed the filename field this would automatically keep all the tag info?

That's the way I handle it when Windows catches a file being renamed, but when a file is moved, Windows doesn't say "Hey, look, this file has moved here" it says "He look, this file here has been deleted." and separately, "Oh, hey, look, this file here has been created." so when I catch the delete there's no way to tell whether that delete operation is part of a move operation or a delete operation.
I'm trying to get the temporary MPL thing that Mr Raymond sugested happening and just keep a cache of MPLs for a certain amount of time and compare file creation filenames to the filenames of the recently deleted items. Problem is I can't use the GetFields() function to save all the database fields because the SDK is all broken (see this thread).

We'll see...

Scott.
Logged

LisaRCT

  • Guest
Re:In Development: Media Sync
« Reply #9 on: January 01, 2004, 01:19:44 pm »

Wow, this sound like a great addition to the power of MC.

I understand the folks at J.R. are overwhelmed (yet still doing an excellent job), but it would be nice if they could at least have acknowledged any future plans to incorporate this function into MC.  I'd hate to see all this work done on a wonderful plugin, only to have them 'absorb' the function in to the core of MC thus nullifying your efforts.

In any case this sound like something I'd be interested in using.
Logged

scott_r

  • Regular Member
  • Galactic Citizen
  • ****
  • Posts: 306
Re:In Development: Media Sync
« Reply #10 on: January 02, 2004, 02:40:39 am »

For me, writing plugins is, like any programming, inherently fun. I wouldn't see it as time wasted if JRiver did it themselves.
However, I can't make the plugin the way I want to make it (useable, flexible, intuitve, etc) without some serious SDK improvements, which we are yet to hear about from JRiver.
The missing GetFields() function is, i think, one of the only things stopping me from continuing.

I guess that's what you get when you're a third party developer.

Scott.
Logged

speckracer

  • Regular Member
  • Member
  • *
  • Posts: 2
  • moo
Re:In Development: Media Sync
« Reply #11 on: January 23, 2004, 04:35:40 pm »

Scott_r,
Could you share with us how you went about automatically updating the library? I'd like to see a plugin that does it every x seconds/minutes. Are you doing it through window messages? what command are u using?

Any chance for us to view the source?  If not, I'll settle for being a beta tester..

Thanks,
jim a.
Logged

scott_r

  • Regular Member
  • Galactic Citizen
  • ****
  • Posts: 306
Re:In Development: Media Sync
« Reply #12 on: January 24, 2004, 10:34:34 pm »

Replied via email...

Windows messages aren't the way to go, instead use the SDK instead.

Scott
Logged

Tolga

  • Regular Member
  • Galactic Citizen
  • ****
  • Posts: 438
Re:In Development: Media Sync
« Reply #13 on: January 25, 2004, 06:48:55 pm »

I have an idea that seems to be relevant. It should be easy to implement for someone who knows how to do it.

Typical Senario: Server contains many files. The laptop library points to files in the server location. At home you can listen to all; but you cannot take all with you because space in the laptop is limited.

I open the folders of files (with locate externally), and choose "make available offline". I would love to be able to make this within MC. If you make changes to song tags on the offline files, the server files will be updated automatically. Maybe someone can implement this using send to external program feature.
Logged

rfehr

  • Regular Member
  • Recent member
  • *
  • Posts: 5
Re:In Development: Media Sync
« Reply #14 on: January 27, 2004, 01:00:01 am »

I've been dying for this feature.  In fact, I'm on the fence about tossing out MC in favor of something - with admittedly fewer overall features - that can catch filesystem change events and import new files automatically.

Here's what we do:

- Headless media server (large hard drive, SB 5.1 card with kx drivers making it a 3 zone stereo card) running MC and Cinemar MusicLobby.
- remote touchscreens in each audio zone - typically ViewSonic AirPanels running the MusicLobby interface (alternatly PocketPC's or in-wall touchscreen PC's).

The issue is that the user has no real UI access to MC.  Ideally, MC would be configurable to use a central remote database and we could simply install MC on annother PC and have all media importing / playlist editing reflected in one master database which all MC clients would be pointed to.  By the way, if you want to write a cool plug in, write a shim that disassociates the MC database withe the application - speak MC up to the application (making it think that it's own database files were being interacted with) and point to a MySQL database in the back.

Failing this, the best (and easiest) solution is exactly what you're proposing.  End users would have access to the shared media directory on the server where they could drop new music and playlists which would then be automagicly picked up by MC.

Images in the ID3 tag is however an issue as Cinemar currently does not like images in the files.  This is not a big deal however as there are many ways of solving this problem

PLEASE keep me informed of progress.
Logged

scott_r

  • Regular Member
  • Galactic Citizen
  • ****
  • Posts: 306
Re:In Development: Media Sync
« Reply #15 on: January 27, 2004, 01:46:23 am »

Hi everybody!

Thanks for speaking up about your interest in the plugin. Sadly, there isn't enough support in the SDK to implement MediaSync at the moment.

Currently the limitations are:
1) There is no way to "silently" remove a file from the database, ie, every time a file is deleted, the user must confirm it.
2) There is no way to access the list of fields a user has in his/her database
3) Tags aren't imported on an import via the SDK.

These are all issues at JRiver's end, not mine, so until we see changes/updates to the SDK, my hands are tied.

Sad, but true.

Thanks heaps for your support, and I will keep you all posted if the necessary changes happen. Feel free to voice your support for an improved SDK to JRiver.

Scott.
Logged

Nikolay

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 1681
  • Former CTO, JRiver, Inc.
Re:In Development: Media Sync
« Reply #16 on: January 29, 2004, 04:42:50 pm »

Scott,

1) We will implement the "silent delete" function in the next build
2) if you import Media Centers automation into your project, you will find two interfaces called MJFieldsAutomation and MJFieldAutomation. Use them to access field information. The information is limited to Name of a field. We will add this information to our automation documentation in the near future.
3) Are you using MJAutomation.ImportFile function?

Nikolay
Logged

scott_r

  • Regular Member
  • Galactic Citizen
  • ****
  • Posts: 306
Re:In Development: Media Sync
« Reply #17 on: January 30, 2004, 04:19:56 am »

Nikolay - You have no idea how great it is to see you posting in this thread!! THANK YOU SO MUCH!

Quote
1) We will implement the "silent delete" function in the next build
Great! While you're in the mood for implementing SDK functions, why not check out this thread...

Quote
2) if you import Media Centers automation into your project, you will find two interfaces called MJFieldsAutomation and MJFieldAutomation. Use them to access field information. The information is limited to Name of a field. We will add this information to our automation documentation in the near future.
I'm now able to access the MJFields and MJField automation interfaces, but when I call GetName(bool) on a MJFieldAutomation object I get an "Invalid number of parameters" runtime error (using c# .net).

Quote
3) Are you using MJAutomation.ImportFile function?
You guys pulled a sly one on us, didn't you... It seems to be working now, although I swear the tags weren't being updated when I first posted. Oh well... one less thing to do :)

Once again, thanks for the reply.. It's great to see you're getting back into SDK development again!

Cheers,

Scott
Logged

Nikolay

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 1681
  • Former CTO, JRiver, Inc.
Re:In Development: Media Sync
« Reply #18 on: January 30, 2004, 12:02:56 pm »

Scott,

We will take a look at the Fields bug. Hopefully we will be able to fix it by the next build.

We apologize that we are not as helpful as we could be, but we are extremely busy with the new development (see JimH's post in the main MC 9 forum)

We will try to stay on top of things in the future.

Thanks,
Nikolay
Logged

johnp

  • World Citizen
  • ***
  • Posts: 145
  • let your 'Yes' be 'Yes,' and your 'No,' 'No'
Re:In Development: Media Sync
« Reply #19 on: January 30, 2004, 06:07:25 pm »

I am happy to see this post ;D.  I have been dying for this feature.  It is sorely needed and I  would encourage J.R. to support this as much as it is possible.  I mean how great is it that a third party person is willing to develope important functionality for free.  It's a beautiful thing.

I do want to put my 2 cents in about tags.  I currently do not have a way to tag files because I use wav files for reasons I won;t go into here, and sadly JRiver does not support wav file tagging  >:(.

So at any rate it would be important for me to have a way to signal share tag info between the boxes that would do the DB syncing.  exporting the mpl of new files seems like a decent work around to me.

Thanks so much for your efforts on this worthy cause!!!
Logged

scott_r

  • Regular Member
  • Galactic Citizen
  • ****
  • Posts: 306
Re:In Development: Media Sync
« Reply #20 on: January 31, 2004, 07:20:20 am »

Quote
Scott,

We will take a look at the Fields bug. Hopefully we will be able to fix it by the next build.

We apologize that we are not as helpful as we could be, but we are extremely busy with the new development (see JimH's post in the main MC 9 forum)

We will try to stay on top of things in the future.

Thanks,
Nikolay

This is the best news I've heard in ages.
Thanks so much,

Scott.

edit: Sorry, I haven't kept up to date with the MC9 forum apart from the builds... where is this post from Jim you talk about?
Logged

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 72442
  • Where did I put my teeth?
Re:In Development: Media Sync
« Reply #21 on: January 31, 2004, 07:37:28 am »

Scott,
It's gone.  What I said was that we were working on polishing and making the program easier to use for a more "typical" user.  We've watched a number of inexperienced users wander around inside the program just looking for simple things like what to do next in a burn process.  We think we've fixed these.

The reason we're doing this is that we have a large customer that needs it.  You should see more on this in the spring.

The post turned into a place for people to complain about future pricing policies, so I ended up deleting it.

This isn't something we can discuss now, so please be aware that I may delete or edit comments in this thread.  It's nothing personal.  We just can't let the news out.

Thanks for your work.

Jim
Logged
Pages: [1]   Go Up