Jump to content

4.1.0.26 Where is IResolverIgnoreRule?


rhodges

Recommended Posts

rhodges

IResolverIgnoreRule

https://github.com/MediaBrowser/Emby/wiki/Automatic-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
Link to comment
Share on other sites

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?

Link to comment
Share on other sites

rhodges

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  :)

Link to comment
Share on other sites

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

Link to comment
Share on other sites

rhodges

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).

Link to comment
Share on other sites

rhodges

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?

Link to comment
Share on other sites

  • 3 weeks later...
rhodges

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.

Link to comment
Share on other sites

  • 3 weeks later...
rhodges

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;
        }
    }
Link to comment
Share on other sites

  • 4 weeks later...
rhodges

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 :)

Link to comment
Share on other sites

If you just want to ignore hidden files, i was thinking i could just add a hidden config switch for that. Occasionally this gets requested by other users so i think would make more sense. It won't be in the UI for now so you'd have to set the option in a config file, but that ought to work. Will that suffice?

Link to comment
Share on other sites

  • 1 month later...
warloxxjay

I also made a little plugin that ignored files with certain extensions.

Specifically I used it to ignore the raw files of my photo library. Each raw file has also a jpg with the same name besides it. I really didn't want the photo library have every image twice (the raw files are also much bigger and take up way to long to load).

 

So it would be great if there is some similar way to accomplish this.

 

I would be fine with putting a .ignore.cr2 file in the folders or something similar so that it only would ignore .cr2 files but still index the rest.

Link to comment
Share on other sites

  • 2 weeks later...

If you just want to ignore hidden files, i was thinking i could just add a hidden config switch for that. Occasionally this gets requested by other users so i think would make more sense. It won't be in the UI for now so you'd have to set the option in a config file, but that ought to work. Will that suffice?

Apologies for the extremely delayed response. That would work for me, but that wouldn't be enough for @@warloxxjay (see above).

 

My opinion would be to add the IResolverIgnoreRule back in (maybe with some changes to aid in performance if needed) then people like me and @@warloxxjay could do our own thing that could be superceeded by a nifty plugin that could be released to manage hidden/custom things. If time permits, I'd create the plugin/UI for it.

Link to comment
Share on other sites

  • 1 month later...
rhodges

Any chance we can get this back in in time for the next release? I'm still hanging back with an older version. If you add it back, I promise i won't come here complaining of slow library scans without disabling my plugin to check first  ;)

Link to comment
Share on other sites

Any chance we can get this back in in time for the next release? I'm still hanging back with an older version. If you add it back, I promise i won't come here complaining of slow library scans without disabling my plugin to check first  ;)

 

@@rhodges, all you're trying to do is ignore hidden files. that seems like a hidden config option that would probably benefit everyone. So in your case, I think that's a better approach then a plugin. I can just make this a core feature and then you may have to manually edit a config file.

Link to comment
Share on other sites

warloxxjay

Would it be possible to expand that to ignore files by file extension?

That was my use-case for that interface. I don't like having every picture in my photos library twice because I keep jpg and raw next to each other.

Link to comment
Share on other sites

Would it be possible to expand that to ignore files by file extension?

That was my use-case for that interface. I don't like having every picture in my photos library twice because I keep jpg and raw next to each other.

 

Yes that's reasonable as well. Thanks.

Link to comment
Share on other sites

This will be in 4.3.0.16+ and will require editing the options.xml file for each library that you wish to set this for. Two new properties:

  • IgnoreHiddenFiles - true/false
  • IgnoreFileExtensions - array of string, for example ".abc", ".xyz"

 

@@Happy2Play

  • Like 1
Link to comment
Share on other sites

If you'd like to try the beta server then I can tell you how to test the new config switches. Thanks.

Link to comment
Share on other sites

I'm also changing the ignore rules for sample files to only ignore under 300 mb, and i'll put this into library options where you can  manually customize that size by editing the config file. This should help resolve some sample file issues.

 

@@Happy2Play

Link to comment
Share on other sites

warloxxjay

The UI has an "show advanced settings" on the mange library already. Wouldn't that be a good place to put these? In the UI would definitely be easier to access.

I'm currently not running any beta instances so I can't test it at the moment. Great to see the feature coming back though :)

Link to comment
Share on other sites

PenkethBoy

For those wondering why you cant see the new Ignore options in the options.xml for a library in the latest couple of betas - you need to get Emby to re save the Library options file - i.e. "edit" each library in turn - for them to be added

 

@@Luke

  • Like 1
Link to comment
Share on other sites

For those wondering why you cant see the new Ignore options in the options.xml for a library in the latest couple of betas - you need to get Emby to re save the Library options file - i.e. "edit" each library in turn - for them to be added

 

@@Luke

 

Ah yes, great info, thanks !

Link to comment
Share on other sites

  • 2 weeks later...
rhodges

I've been away, distracted with other things and I just came back here and noticed this. I really appreciate you bringing this back. I'll update Emby this week and try it out. I'm really looking forward to getting up to date with latest and greatest!

 

Thanks @@Luke!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...