Skip to content

Filter pattern replacement#16

Open
cquijano wants to merge 5 commits into1100101:masterfrom
cquijano:filter_pattern
Open

Filter pattern replacement#16
cquijano wants to merge 5 commits into1100101:masterfrom
cquijano:filter_pattern

Conversation

@cquijano
Copy link

This patch is useful to get tv shows in folders (as Kodi need for example).
I have some like this in my automatic.conf

filter = { 
           pattern => "(.*)(\d+)x(\d+)"
           folder  => "/storage/videos/tvshows/\1"
           feedid  => 1                 
         }

So when a pattern mach, the tv show is added to it's folder.

@cquijano
Copy link
Author

I think this fix the issues:

  • Sorry for bad comments, I wrote them when I was reading the code, my bad.
  • I need download_folder_reg and download_folder to avoid memory leak or segmentations faults.
if(isMatch(session->filters, item->name, feedID, &download_folder, &filter_pattern)) 
....
download_folder_reg = rewriteURL(item->name, filter_pattern, download_folder);

In first line, download_folder can't be freed because is only a ref , but in the second line download_folder_reg, must be freed, so I need 2 vars. (Or I think so)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants