[PLUGIN][DRFTPD 2] CreateLinks (mp3 sorted, last upload,ecc)

A place for mods with no support from someone in the "developers" group

Moderator: developers

[PLUGIN][DRFTPD 2] CreateLinks (mp3 sorted, last upload,ecc)

Postby N3m3Sis17 » Mon Dec 12, 2005, 12:37 pm

I code this plugin, it create generic link on generic event:
-mp3 event
-new dir create
-sfv event
-ecc.

you can set the name of link creted (file CreateLinks.properties) and others parameter (links.conf):

Code: Select all
*links.X.dirname= (path where create the link - if it is "/" and section are "*" create link into section path)
*links.X.event= (event on which create the link: MP3EVENT-SFVEVENT-MKD-ecc.)
*links.X.section= (section on which monitoring event - * for all)
links.X.addupdir= (if the dir match this regex the link name contain up dir name too, example: on \cd1 the link created is release::cd1)
links.X.subdir= (create link into subdir in X.dirname: mp3tag or regex
  MP3 Available tags are genre, year, title, album, artist
  regex syntax is: regex:group:string (for info view http://java.sun.com/j2se/1.5.0/docs/api/java/util/regex/Pattern.html)
                   it use the group for subdir
links.X.deleteon= (event on which delete the link: COMPLETE-NUKE-WIPE-RMD-ecc.)
links.X.exclude= (exclude this dirs - regex)


* are obligatory

deleteon event on mp3 tag don't work, however the plugin delete ghost links in auto with Timer cycling with configurable time
Code: Select all
links.cyclingtime=86400


add this plugin into drftpd.conf
Code: Select all
plugins.X=org.drftpd.plugins.CreateLinks


v1.1:
-fix DIZ complete
-add * on .section
-add findGhost.dir param
if don't specific findGhost.dir it search into all links.X.dirname
-add example for incomplete links



v. 1.2

-fix the problem on NUKE and WIPE
-fix the case insensitive
-fix the autocreate base path
-fix site reload
-add links.separator param


Bye
N3m3Sis
You do not have the required permissions to view the files attached to this post.
Last edited by N3m3Sis17 on Fri Dec 16, 2005, 11:21 pm, edited 3 times in total.
N3m3Sis17
 
Posts: 77
Joined: Wed Dec 01, 2004, 2:11 pm

Postby zonp » Mon Dec 12, 2005, 1:28 pm

sounds like a nice mod.
thanks for sharing.
zonp
 
Posts: 15
Joined: Sun Nov 21, 2004, 8:43 am

Postby Prometheus » Mon Dec 12, 2005, 1:46 pm

Haven't tried it yet, but sounds very nice!!
Prometheus
Node's little helper
 
Posts: 291
Joined: Sun Dec 12, 2004, 8:19 pm

Postby erich » Mon Dec 12, 2005, 3:00 pm

sounds very impressive, lets load it for a test :)
good work !!
erich
Node's little helper
 
Posts: 574
Joined: Mon Nov 29, 2004, 12:50 pm

Postby tworkemon » Mon Dec 12, 2005, 5:56 pm

Yes, yes it does might have to look into this myself.
tworkemon
Node's little helper
 
Posts: 258
Joined: Fri Dec 10, 2004, 9:15 pm

Postby JJLIT » Mon Dec 12, 2005, 6:07 pm

very interesting... I loaded it for a quick test and it worked as described.

Thanks!
JJLIT
 
Posts: 43
Joined: Mon Dec 13, 2004, 1:28 pm

Postby erich » Tue Dec 13, 2005, 1:10 am

NOTE:
With the current version you NEED to make the directories yourself.

Code: Select all
links.1.dirname=/MP3/SORTED/BY-GENRE
....
....
links.2.dirname=/MP3/SORTED/BY-YEAR
....
....
links.3.dirname=/MP3/SORTED/BY-CREW
....
....

In this case you would need to do:
Code: Select all
MKD /MP3/SORTED
MKD /MP3/SORTED/BY-GENRE
MKD /MP3/SORTED/BY-YEAR
MKD /MP3/SORTED/BY-CREW


If you don't make those directories, nothing will happen.
Actually the plugin should add them automatically. But I assume the next version will have fixed this minor issue 8)
erich
Node's little helper
 
Posts: 574
Joined: Mon Nov 29, 2004, 12:50 pm

Postby tworkemon » Tue Dec 13, 2005, 2:56 am

Does !reload work with this... I dont think I saw anything in the code about it but it might be the lack of my java skillz.

Maybe an option ??
Code: Select all
public void actionPerformed(Event event) {
       String cmd = event.getCommand();
       if (cmd.equals("RELOAD")) {
         try {
            reload();
         } catch (IOException e) {
            logger.log(Level.WARN, "", e);
         }
      }

And other coding aswell but something along those lines ??
tworkemon
Node's little helper
 
Posts: 258
Joined: Fri Dec 10, 2004, 9:15 pm

Postby Phoenix9 » Tue Dec 13, 2005, 4:45 am

I played around with the options for this mod a little, and it can be used for incomplete links for sections as well,

links.conf
links.4.dirname=/DVDR
links.4.event=MKD
links.4.section=DVDR
links.4.deleteon=COMPLETE;NUKE;WIPE;RMD;
links.4.exclude=sample

Createlinks.properties
link4=(incomplete)-${dirname}

will have to be done for each section. I have not tried it for dated sections, but I think it will be a simple change to the code to add the date variable.

Very nice mod N3m3Sis17 :)
Phoenix9
 
Posts: 93
Joined: Sat Nov 27, 2004, 4:05 am

Postby erich » Tue Dec 13, 2005, 7:31 am

tworkemon wrote:Does !reload work with this... I dont think I saw anything in the code about it but it might be the lack of my java skillz.


You're right, the reload is infact missing.
Until its added users can use:
Code: Select all
site unloadplugin org.drftpd.plugins.CreateLinks
site loadplugin org.drftpd.plugins.CreateLinks
erich
Node's little helper
 
Posts: 574
Joined: Mon Nov 29, 2004, 12:50 pm

Postby N3m3Sis17 » Tue Dec 13, 2005, 9:16 am

For !reload command erich answer for me ;)

for Phoenix9 you must put a regex string into .exclude, example:
Code: Select all
^/(.*)/(sample|subs|covers)$


for dated link (-today) there is into section.conf this features!!

for manual crete of the dir I fix it in next version. :)

Bye
N3m3Sis17
 
Posts: 77
Joined: Wed Dec 01, 2004, 2:11 pm

Postby erich » Tue Dec 13, 2005, 9:36 am

I have a few comments on the input that was added on incomplete-........ symlinks:

links.conf:
Code: Select all
links.4.dirname=/
links.4.event=SFVEVENT
links.4.section=*
links.4.deleteon=COMPLETE;NUKE;WIPE;RMD;
links.4.exclude=^/(.*)/(sample|subs|covers)$

Createlinks.properties:
Code: Select all
link4=(incomplete)-${dirname}


Well... would be nice if above would work. So you don't have to add each and every section which is rather trivial. The exclude will fix the sections/directories that you don't want the incomplete links on.
If this would be fixed people could use this plugin instead of modding the core (DataConnectionHandler.java, ListUtils.java) of drftpd with the mod [MOD][2.0] Incomplete links.
But from what I can read in the code, it doesn't support * or empty sectionnames. Maybe N3m3Sis17 could add that aswell :)

I do see a potential bug on section 0DAY where releases are completed but the sfvstatus doesn't apply as 0DAY is based on builtin DIZ files and not SFV file. But I didn't test it, just reading the code.
Last edited by erich on Tue Dec 13, 2005, 10:20 am, edited 1 time in total.
erich
Node's little helper
 
Posts: 574
Joined: Mon Nov 29, 2004, 12:50 pm

Postby N3m3Sis17 » Tue Dec 13, 2005, 10:09 am

The .section option there is only for optimized event cycle.

I could add regex string in this param too. But support of the * (or regex) not optimized null :( .

I try to add param to specific dir where the plugin search the ghost link, for optimized the code. Search everywhere it is very expensive.

For incomplete link however I think that is more exact to used a SFVEVENT and not MKD (in fact the complete event is generated only on dir with .sfv dir)

for example:
(with MKD)
MKD release
MKD release/cd1
MKD release/cd2
it create 3 link incomplete on COMPLETE event (on cd1 and cd2) it delete link cd1 and cd2 and release up dir (it don't have COMPLETE event, there isn't sfv file into)?

(with SFVEVENT)
SFVEVENT release/cd1/one.sfv
SFVEVENT release/cd2/two.sfv
it create 2 link incomplete on COMPLETE it delete all.

But I don't think that the use of this plugin to create this link (incomplete) it is correct. For view the incomplete dir there is !incomplete or site find -incomplete command.

As the other FTP server has this features does not want to say that is good features :wink:
N3m3Sis17
 
Posts: 77
Joined: Wed Dec 01, 2004, 2:11 pm

Postby Prometheus » Tue Dec 13, 2005, 10:16 am

N3m3Sis17 wrote:As the other FTP server has this features does not want to say that is good features :wink:


The (incomplete) links are a good feature imho :P
Prometheus
Node's little helper
 
Posts: 291
Joined: Sun Dec 12, 2004, 8:19 pm

Postby N3m3Sis17 » Tue Dec 13, 2005, 10:21 am

For find incomplete dir or for other?

If it is for find incomplete I prefer "site find -incomplete" :lol:
If the problem is another perhaps the link create not is the good solution.

For the "last up" (for the races) it is good solution have a dir where create all link. The plugin work less.

For DIZ I fix it.

Tnx erich for test
Last edited by N3m3Sis17 on Tue Dec 13, 2005, 10:30 am, edited 2 times in total.
N3m3Sis17
 
Posts: 77
Joined: Wed Dec 01, 2004, 2:11 pm

Next

Return to New & Rogue Mods

Who is online

Users browsing this forum: No registered users and 0 guests