mp3geek

Notification of new files

8 posts in this topic

New to Apex DC++,

 

I'm after a script that notifys a channel of any new files been added to a directory, is there any notification scripts for Apex?

Share this post


Link to post
Share on other sites

Hi guys

 

Also looking for such a plugin.

 

Is there any developers that can let us know if it's even possible.

It will be great if there is a plugin that once a file is added and hashed to auto copy the magnet link to the channel.

 

Please guys help us out.

Share this post


Link to post
Share on other sites

It would be possible to do for files downloaded using ApexDC itself, for files simply added to share, however, it would not be possible.

Share this post


Link to post
Share on other sites

Hi Cris, why do you think it's not possible? Let's face the problem. What are the new files in share? It's diff between your current filelist and your filelist before last indexing. So let's pretend that we have plugin which is capable of:

  • store the actual filelist as temporary before each indexing
  • after each indexing take actual and temporary filelists, do the diff and save result somewhere
  • on user command or automatically after indexing send the result to the hub chat

What makes it impossible to create such a plugin?

Share this post


Link to post
Share on other sites

Hi Cris, why do you think it's not possible? Let's face the problem. What are the new files in share? It's diff between your current filelist and your filelist before last indexing. So let's pretend that we have plugin which is capable of:

  • store the actual filelist as temporary before each indexing
  • after each indexing take actual and temporary filelists, do the diff and save result somewhere
  • on user command or automatically after indexing send the result to the hub chat
What makes it impossible to create such a plugin?

For one, that way of doing it would involve a lot of heavy lifting on the plugins part, and does not really describe a plugin anymore... and even then plugins have no way of reacting to filelist updates naturally as it stands (ie. they will not know when your share has been updated, outside of completed downloads, beyond monitoring the filesystem on OS level).

If you want to think of it differently, the work required to make this happen is substantial enough that at that point going the extra mile to make a fully fledged bot wouldn't be that much of an undertaking. In other words it is not impossible but it is impractical, because the plugin system couldn't really help the plugin in any significant way.

The bottom line: there are very few things that are truly impossible, when it comes to programming, but a lot more that are not possible with reasonable effort. The method you described may seem simple, but in truth it is anything but that, in comparison to limiting this hypothetical plugin to only downloaded files. Now, if API changes were made the situation might change, significantly even, but typically doing API changes for a single plugin is a bad idea (any API changes made should have more than one potential use case). Regardless, as it stands creating such a plugin at present is in fact not possible.

Peetboy likes this

Share this post


Link to post
Share on other sites

Thanks for explanation. I thought about plugin as something that should do "some extra work" which main program is not capable of do. And of course communicate with main program. Perhaps I was looking at it from wrong angle.

 

Edit: Wouldn't it be possible with Lua plugin?

Share this post


Link to post
Share on other sites

Thanks for explanation. I thought about plugin as something that should do "some extra work" which main program is not capable of do. And of course communicate with main program. Perhaps I was looking at it from wrong angle.

 

Edit: Wouldn't it be possible with Lua plugin?

The problem with that way of thinking is that it includes things that would probably be easier to do as direct modifications to the application than as a plugin currently. Something like this, however, is something that a minority of people would use and because of that if done it should be a plugin in my opinion. So yes, just as an idea and a concept it is perfect fit for a plugin.

On a basic level your definition of plugin is fine, but it is a little too permissive. The way I (as someone who has the ability to choose between two approaches) would define a plugin is a piece of reusable programming/work, because this API is shared between several applications, that can be distributed separately of the original application. In an ideal scenario this means that the work can be divided because the ones maintaining the parent applications don't have to develop everything. But of course it doesn't make sense to create a plugin if it is more work than developing something as a permanent part of an application, however, not everything is a good fit for that either.

 

It could in theory be done through lua script (which is in essence just a different kind of plugin, that happens to be realized as a plugin itself) but even then the way to do it would be complicated, which doesn't really add up with the idea that plugins should make development easier not harder. The reason why plugins are supposed to make development easier is because what they can do is usually more limited than what you can do if modifying the parent (host) application directly and they come with well defined "rules" if you will.

 

So it is not so much what either side is and isn't capable of doing but who is capable of doing it and how, as well as how much knowledge is needed. The sharing of plugins between applications is an added bonus. Example: it is easier for someone not familiar with DC++ code to develop a plugin than to create a feature as part of DC++ because you only need to learn one API to interact with the application as opposed to the potentially dozens of classes and interfaces that make the API you are using tick, however, for someone familiar with the code it makes no sense to develop a plugin that we know is probably easier to do otherwise.

Share this post


Link to post
Share on other sites

Ok I did some digging and see that everytime a file is hashed a line is written to the system log file.

 

example...

 

[saturday September 28 08:58:37] Finished hashing: ...TBBT S7TBBT S07E01.mp4 (110.21 MiB/s)

 

Is it not possible to write a script that as soon as an entry get written to the system log that it then displays it to the channel?

Share this post


Link to post
Share on other sites