Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filter on Empty Values or Any Values #103

Open
SolusCado opened this issue Dec 3, 2024 · 9 comments
Open

Filter on Empty Values or Any Values #103

SolusCado opened this issue Dec 3, 2024 · 9 comments
Labels
enhancement New feature or request

Comments

@SolusCado
Copy link

I would like to setup two separate cards, one that shows all items where a specific attribute (Studio) is empty, and one where that attribute has any value at all. I cannot seem to get this to work.
I can use 'sort_by' on the 'studio' attribute to group the items, but I need to put them in separate cards so I can restrict who can see a specific grouping.
Is there any way to specify something like "filter: studio=''" or "filter: studio=empty"? (And conversely, "filter: studio!=''" or "filter: studio!=empty"...)

@SolusCado SolusCado added the enhancement New feature or request label Dec 3, 2024
@mkanet
Copy link
Collaborator

mkanet commented Dec 3, 2024

Hi @SolusCado please try version 0.6.1. I just updated this repo a few minutes ago with this enhancement. Please note that when upgrading Upcoming Media Card, sometimes, it requires deleting your web browser cache to remove lingering old upcoming media card javascript code after upgrading to the new version.

Let me know how it works for you!

@SolusCado
Copy link
Author

SolusCado commented Dec 4, 2024 via email

@mkanet
Copy link
Collaborator

mkanet commented Dec 4, 2024

Honestly, I didnt test this yesterday since I thought I was a pretty straight-forward fix. Can you post the full EXACT card code you're using? Ill see if I can reproduce the issue.

@SolusCado
Copy link
Author

SolusCado commented Dec 4, 2024

There isn't much to it:

type: custom:upcoming-media-card
title: Recently Added
entity: sensor.media_library_plex_recently_added
image_style: fanart
enable_tooltips: true
enable_transparency: true
hide_unflagged: false
flag: false
filter: studio=""
max: 20

@mkanet
Copy link
Collaborator

mkanet commented Dec 5, 2024

@SolusCado I tried to test this on my setup before uploading version 0.6.2. However, I had no Sonarr shows to test against that currently have no studio defined. Please try it let me know if it works

@SolusCado
Copy link
Author

SolusCado commented Dec 5, 2024 via email

@mkanet
Copy link
Collaborator

mkanet commented Dec 6, 2024

I dont know why I didnt think of that before. I just tested it. The following works: filter: studio="" or filter: studio=''

@SolusCado
Copy link
Author

Ok; those still don't work for me - BUT this does:
filter: studio=

So, if I just leave it blank to the right of studio, it filters out any records with any value at all. So, that's good enough.

NOW... is there any way to reverse that? To show a wildcard or something, so that I only get records WITH a studio?

@mkanet
Copy link
Collaborator

mkanet commented Dec 12, 2024

Ok; those still don't work for me - BUT this does: filter: studio=

So, if I just leave it blank to the right of studio, it filters out any records with any value at all. So, that's good enough.

NOW... is there any way to reverse that? To show a wildcard or something, so that I only get records WITH a studio?

Glad its working for you. If you have a suggestion on how to reverse this using filter setting, let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants