Jump to content


Photo

4.1.0.26 Where is IResolverIgnoreRule?


  • Please log in to reply
9 replies to this topic

#1 rhodges OFFLINE  

rhodges

    Advanced Member

  • Members
  • 188 posts
  • Local time: 04:59 AM

Posted 18 April 2019 - 11:54 AM

IResolverIgnoreRule

https://github.com/M...-Type-Discovery

 

Can anyone tell me if this has been removed, or moved to a different dll? Since the source closed up, I can't just go look for it myself anymore  :(

 

Edit: Decompiling things, it looks like it is gone?? And to top it off, you never fixed the bug where the auto upgrade turns itself back on, so now as soon as my Emby restarts, it'll upgrade and I'll have to fix it, turn it off and figure something else out?

 

Edit 2: All of your ignore logic is hard coded inside CoreResolutionIgnoreRule and that isn't even injected into LibraryManager? Seems like a step back in your design.


Edited by rhodges, 19 April 2019 - 02:36 PM.


#2 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 131427 posts
  • Local time: 05:59 AM

Posted 22 April 2019 - 04:38 PM

I removed it to avoid having to loop over a list of rules for every single file. I didn't realize anyone was using this. What are you trying to accomplish?



#3 rhodges OFFLINE  

rhodges

    Advanced Member

  • Members
  • 188 posts
  • Local time: 04:59 AM

Posted 29 April 2019 - 12:23 PM

I used it to bring back the option to ignore hidden files.

 

A lot of anime use linked files for opening/closing credits. I don't want to remux things into a single file. I want to retain the original files, without any name changes, etc. At one point, you ignored them and life was good.

 

That was removed. We chatted about that a bit in a different thread and basically, that ability wasn't going to be added back. After I discovered that interface, I was happy and added it back for myself.

 

Now that interface is gone. It seems you are determined not to allow me to ignore hidden files  :)



#4 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 131427 posts
  • Local time: 05:59 AM

Posted 02 May 2019 - 02:15 PM

If and only if it's not going to impact library can performance, then i can look at adding it back. thanks.



#5 rhodges OFFLINE  

rhodges

    Advanced Member

  • Members
  • 188 posts
  • Local time: 04:59 AM

Posted 02 May 2019 - 04:00 PM

I never had a problem with it. Of course, you/we will be at the mercy of plugin developers. If the list is empty, aka, no developer injected anything, then it shouldn't have any impact. But, if a nefarious/bad developer wanted to do something stupid inside it, then there will be a problem.

 

Feel free to optimize or adjust as needed. I'm just looking for a hook, with the path to the file that I can give you a yes/no to import it. Assume yes, first person who says no, exit (which is what was there if I am not mistaken).



#6 rhodges OFFLINE  

rhodges

    Advanced Member

  • Members
  • 188 posts
  • Local time: 04:59 AM

Posted 10 May 2019 - 12:25 PM

If and only if it's not going to impact library can performance, then i can look at adding it back. thanks.

Sorry to be a bother, but, is this something you're still considering adding back? Anything I can do to help? Or just be quiet and let you work?



#7 rhodges OFFLINE  

rhodges

    Advanced Member

  • Members
  • 188 posts
  • Local time: 04:59 AM

Posted 26 May 2019 - 08:55 PM

Any news? I took a peek at the latest beta but didn't see any way to hook into the scan process. Is it still being considered? I am at an upgrade stand-still.



#8 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 131427 posts
  • Local time: 05:59 AM

Posted 16 June 2019 - 01:46 PM

Is your ignore rule simple, like based on a specific file or folder name?



#9 rhodges OFFLINE  

rhodges

    Advanced Member

  • Members
  • 188 posts
  • Local time: 04:59 AM

Posted 18 June 2019 - 09:01 AM

Is your ignore rule simple, like based on a specific file or folder name?

It is. It just checks if the file is hidden.

 

Running the scan media library task against my library takes around 48 seconds, which includes the code for my rule.

 

48.3 TB
27,187 files
4,369 folders

 

The code should look familiar. I think I cribbed (most of) it from an old version of Emby somewhere.

    public class Ignore : IResolverIgnoreRule
    {
        private readonly IFileSystem _fileSystem;
        private readonly ILogger _logger;

        public Ignore(IFileSystem fileSystem, ILogger logger)
        {
            _fileSystem = fileSystem;
            _logger = logger;
        }

        public bool ShouldIgnore(FileSystemMetadata fileInfo, BaseItem parent)
        {
            // Look for hidden files (not hidden directories)
            if (fileInfo.IsDirectory == false)
            {
                if (parent != null)
                {
                    var path = fileInfo.FullName;
                    var attributes = File.GetAttributes(path);

                    if (attributes.HasFlag(FileAttributes.Hidden))
                    {
                        _logger.Info($"{Constants.PluginName}.Ignore (Ignore) {path}");
                        return true;
                    }
                }
            }

            return false;
        }
    }


#10 rhodges OFFLINE  

rhodges

    Advanced Member

  • Members
  • 188 posts
  • Local time: 04:59 AM

Posted 16 July 2019 - 09:52 AM

Not to be a bother, but I'm hoping IResolverIgnoreRule will be in the next version of Emby in some fashion. Please don't forget me :)






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users