Jump to content


Photo

4.1.0.26 Where is IResolverIgnoreRule?


  • Please log in to reply
29 replies to this topic

#1 rhodges OFFLINE  

rhodges

    Advanced Member

  • Members
  • 192 posts
  • Local time: 11:18 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
  • 156787 posts
  • Local time: 01:18 PM

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
  • 192 posts
  • Local time: 11:18 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
  • 156787 posts
  • Local time: 01:18 PM

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
  • 192 posts
  • Local time: 11:18 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
  • 192 posts
  • Local time: 11:18 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
  • 192 posts
  • Local time: 11:18 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
  • 156787 posts
  • Local time: 01:18 PM

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
  • 192 posts
  • Local time: 11:18 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
  • 192 posts
  • Local time: 11:18 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 :)



#11 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 156787 posts
  • Local time: 01:18 PM

Posted 22 July 2019 - 03:14 PM

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?



#12 warloxxjay OFFLINE  

warloxxjay

    Newbie

  • Members
  • 5 posts
  • Local time: 06:18 PM

Posted 28 August 2019 - 04:24 PM

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.



#13 rhodges OFFLINE  

rhodges

    Advanced Member

  • Members
  • 192 posts
  • Local time: 11:18 AM

Posted 12 September 2019 - 10:30 AM

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.



#14 rhodges OFFLINE  

rhodges

    Advanced Member

  • Members
  • 192 posts
  • Local time: 11:18 AM

Posted 21 October 2019 - 11:17 AM

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



#15 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 156787 posts
  • Local time: 01:18 PM

Posted 26 October 2019 - 03:02 AM

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.



#16 warloxxjay OFFLINE  

warloxxjay

    Newbie

  • Members
  • 5 posts
  • Local time: 06:18 PM

Posted 26 October 2019 - 06:15 AM

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.



#17 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 156787 posts
  • Local time: 01:18 PM

Posted 28 October 2019 - 12:20 AM

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.



#18 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 156787 posts
  • Local time: 01:18 PM

Posted 28 October 2019 - 02:47 PM

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


  • rhodges likes this

#19 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 156787 posts
  • Local time: 01:18 PM

Posted 31 October 2019 - 11:33 PM

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



#20 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 156787 posts
  • Local time: 01:18 PM

Posted 01 November 2019 - 02:54 PM

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






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users