Skip to content

Commit

Permalink
Merge pull request #147 from Tormak9970/dev-visibility-groups
Browse files Browse the repository at this point in the history
chore: merge tab profiles banch into dev
  • Loading branch information
Tormak9970 authored Jan 10, 2024
2 parents be905c8 + 4c8a179 commit 2ac43da
Show file tree
Hide file tree
Showing 73 changed files with 991 additions and 320 deletions.
38 changes: 21 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,27 +35,31 @@ Available Filters:
- **Last Played** - Selects apps that were last played before/after the provided date.
- **Demo** - Selects apps that are/aren't demos.
- **Streamable** - Selects apps that can/can't be streamed from another computer.
- **Steam Features** - Selects apps that support specific Steam Features.
- **MicroSD Card** - Selects apps that are present on the inserted/specific MicroSD Card.

If you want to see another filter, please open a filter request [here](https://github.com/Tormak9970/TabMaster/issues/new/choose).

Filter Examples:
- **Collection**<br/><img src="./assets/docs_collection-example.png" width="600" />
- **Installed**<br/><img src="./assets/docs_installed-example.png" width="600" />
- **Regex**<br/><img src="./assets/docs_regex-example.png" width="600" />
- **Friends**<br/><img src="./assets/docs_friends-example.png" width="600" />
- **Tags**<br/><img src="./assets/docs_tags-example.png" width="600" />
- **Whitelist**<br/><img src="./assets/docs_whitelist-example.png" width="600" />
- **Blacklist**<br/><img src="./assets/docs_blacklist-example.png" width="600" />
- **Merge**<br/><img src="./assets/docs_merge-example.png" width="600" />
- **Platform**<br/><img src="./assets/docs_platform-example.png" width="600" />
- **Deck Compatibility**<br/><img src="./assets/docs_deck-compat-example.png" width="600" />
- **Review Score**<br/><img src="./assets/docs_review-score-example.png" width="600" />
- **Time Played**<br/><img src="./assets/docs_time-played-example.png" width="600" />
- **Size on Disk**<br/><img src="./assets/docs_size-on-disk-example.png" width="600" />
- **Release Date**<br/><img src="./assets/docs_release-date-example.png" width="600" />
- **Last Played**<br/><img src="./assets/docs_last-played-example.png" width="600" />
- **Demo**<br/><img src="./assets/docs_demo-example.png" width="600" />
- **Streamable**<br/><img src="./assets/docs_streamable-example.png" width="600" />
- **Collection**<br/><img src="./assets/filters/docs_collection-example.png" width="600" />
- **Installed**<br/><img src="./assets/filters/docs_installed-example.png" width="600" />
- **Regex**<br/><img src="./assets/filters/docs_regex-example.png" width="600" />
- **Friends**<br/><img src="./assets/filters/docs_friends-example.png" width="600" />
- **Tags**<br/><img src="./assets/filters/docs_tags-example.png" width="600" />
- **Whitelist**<br/><img src="./assets/filters/docs_whitelist-example.png" width="600" />
- **Blacklist**<br/><img src="./assets/filters/docs_blacklist-example.png" width="600" />
- **Merge**<br/><img src="./assets/filters/docs_merge-example.png" width="600" />
- **Platform**<br/><img src="./assets/filters/docs_platform-example.png" width="600" />
- **Deck Compatibility**<br/><img src="./assets/filters/docs_deck-compat-example.png" width="600" />
- **Review Score**<br/><img src="./assets/filters/docs_review-score-example.png" width="600" />
- **Time Played**<br/><img src="./assets/filters/docs_time-played-example.png" width="600" />
- **Size on Disk**<br/><img src="./assets/filters/docs_size-on-disk-example.png" width="600" />
- **Release Date**<br/><img src="./assets/filters/docs_release-date-example.png" width="600" />
- **Last Played**<br/><img src="./assets/filters/docs_last-played-example.png" width="600" />
- **Demo**<br/><img src="./assets/filters/docs_demo-example.png" width="600" />
- **Streamable**<br/><img src="./assets/filters/docs_streamable-example.png" width="600" />
- **Steam Features**<br/><img src="./assets/filters/docs_steam-features-example.png" width="600" />
- **MicroSD Card**<br/><img src="./assets/filters/docs_microsd-card-example.png" width="600" />


# Using the plugin
Expand Down
Binary file removed assets/docs_blacklist-example.png
Binary file not shown.
Binary file removed assets/docs_collection-example.png
Binary file not shown.
Binary file modified assets/docs_context-menu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/docs_create-tab.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed assets/docs_deck-compat-example.png
Binary file not shown.
Binary file removed assets/docs_demo-example.png
Binary file not shown.
Binary file modified assets/docs_edit-ui.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed assets/docs_friends-example.png
Binary file not shown.
Binary file removed assets/docs_installed-example.png
Binary file not shown.
Binary file removed assets/docs_last-played-example.png
Binary file not shown.
Binary file removed assets/docs_merge-example.png
Binary file not shown.
Binary file removed assets/docs_platform-example.png
Binary file not shown.
Binary file removed assets/docs_regex-example.png
Binary file not shown.
Binary file removed assets/docs_release-date-example.png
Binary file not shown.
Binary file removed assets/docs_review-score-example.png
Binary file not shown.
Binary file removed assets/docs_size-on-disk-example.png
Binary file not shown.
Binary file removed assets/docs_streamable-example.png
Binary file not shown.
Binary file removed assets/docs_tags-example.png
Binary file not shown.
Binary file removed assets/docs_time-played-example.png
Binary file not shown.
Binary file removed assets/docs_whitelist-example.png
Binary file not shown.
Binary file added assets/filters/docs_blacklist-example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/filters/docs_collection-example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/filters/docs_deck-compat-example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/filters/docs_demo-example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/filters/docs_friends-example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/filters/docs_installed-example.png
Binary file added assets/filters/docs_last-played-example.png
Binary file added assets/filters/docs_merge-example.png
Binary file added assets/filters/docs_microsd-card-example.png
Binary file added assets/filters/docs_platform-example.png
Binary file added assets/filters/docs_regex-example.png
Binary file added assets/filters/docs_release-date-example.png
Binary file added assets/filters/docs_review-score-example.png
Binary file added assets/filters/docs_size-on-disk-example.png
Binary file added assets/filters/docs_steam-features-example.png
Binary file added assets/filters/docs_streamable-example.png
Binary file added assets/filters/docs_tags-example.png
Binary file added assets/filters/docs_time-played-example.png
Binary file added assets/filters/docs_whitelist-example.png
74 changes: 52 additions & 22 deletions defaults/docs/Filters.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
- Last Played
- Demo
- Streamable
- Steam Features
- MicroSD Card (Requires MicroSDeck)

<br/>

Expand Down Expand Up @@ -50,7 +52,7 @@ Example: Inverting a `Collection` filter would cause it to include any apps **no
Filters apps based on if they are included in the collection.

**Example:**<br/>
<img title="Collection Example" src="https://raw.githubusercontent.com/tormak9970/TabMaster/master/assets/docs_collection-example.png" />
<img title="Collection Example" src="https://raw.githubusercontent.com/tormak9970/TabMaster/master/assets/filters/docs_collection-example.png" />

<br/>

Expand All @@ -62,7 +64,7 @@ Filters apps based on if they are included in the collection.
Filters apps based on their install state.

**Example:**<br/>
<img title="Installed Example" src="https://raw.githubusercontent.com/tormak9970/TabMaster/master/assets/docs_installed-example.png" />
<img title="Installed Example" src="https://raw.githubusercontent.com/tormak9970/TabMaster/master/assets/filters/docs_installed-example.png" />

<br/>

Expand All @@ -77,7 +79,7 @@ Filters apps based on their install state.
- `or`: Filters apps based on if they are owned by any listed friend.

**Example:**<br/>
<img title="Friends Example" src="https://raw.githubusercontent.com/tormak9970/TabMaster/master/assets/docs_friends-example.png" />
<img title="Friends Example" src="https://raw.githubusercontent.com/tormak9970/TabMaster/master/assets/filters/docs_friends-example.png" />

<br/>

Expand All @@ -92,7 +94,7 @@ Filters apps based on their install state.
- `or`: Filters apps based on if they have any listed tag.

**Example:**<br/>
<img title="Tags Example" src="https://raw.githubusercontent.com/tormak9970/TabMaster/master/assets/docs_tags-example.png" />
<img title="Tags Example" src="https://raw.githubusercontent.com/tormak9970/TabMaster/master/assets/filters/docs_tags-example.png" />

<br/>

Expand All @@ -104,7 +106,7 @@ Filters apps based on their install state.
Filters apps by if they are in the list.

**Example:**<br/>
<img title="Whitelist Example" src="https://raw.githubusercontent.com/tormak9970/TabMaster/master/assets/docs_whitelist-example.png" />
<img title="Whitelist Example" src="https://raw.githubusercontent.com/tormak9970/TabMaster/master/assets/filters/docs_whitelist-example.png" />

<br/>

Expand All @@ -116,7 +118,7 @@ Filters apps by if they are in the list.
Filters apps by if they are not in the list.

**Example:**<br/>
<img title="Blacklist Example" src="https://raw.githubusercontent.com/tormak9970/TabMaster/master/assets/docs_blacklist-example.png" />
<img title="Blacklist Example" src="https://raw.githubusercontent.com/tormak9970/TabMaster/master/assets/filters/docs_blacklist-example.png" />

<br/>

Expand All @@ -133,7 +135,7 @@ Regular expressions can seem daunting and confusing. You can test yours before h
Also, by typing a phrase like "Zelda" into the regex field, it will include any game with that phrase in its title.

**Example:**<br/>
<img title="Regex Example" src="https://raw.githubusercontent.com/tormak9970/TabMaster/master/assets/docs_regex-example.png" />
<img title="Regex Example" src="https://raw.githubusercontent.com/tormak9970/TabMaster/master/assets/filters/docs_regex-example.png" />

<br/>

Expand All @@ -150,7 +152,7 @@ Groups a set of filters, allowing you to change the logic mode for smaller sets
By grouping filters you are able to specify the mode for filters in the group seperately, significantly increasing the utility of TabMaster

**Example:**<br/>
<img title="Merge Example" src="https://raw.githubusercontent.com/tormak9970/TabMaster/master/assets/docs_merge-example.png" />
<img title="Merge Example" src="https://raw.githubusercontent.com/tormak9970/TabMaster/master/assets/filters/docs_merge-example.png" />

<br/>

Expand All @@ -162,7 +164,7 @@ By grouping filters you are able to specify the mode for filters in the group se
Filters apps based on their platform.

**Example:**<br/>
<img title="Platform Example" src="https://raw.githubusercontent.com/tormak9970/TabMaster/master/assets/docs_platform-example.png" />
<img title="Platform Example" src="https://raw.githubusercontent.com/tormak9970/TabMaster/master/assets/filters/docs_platform-example.png" />

<br/>

Expand All @@ -175,76 +177,76 @@ Filters apps based on their platform.
Filters apps based on their Steam Deck compatability.

**Example:**<br/>
<img title="Deck Compat Example" src="https://raw.githubusercontent.com/tormak9970/TabMaster/master/assets/docs_deck-compat-example.png" />
<img title="Deck Compat Example" src="https://raw.githubusercontent.com/tormak9970/TabMaster/master/assets/filters/docs_deck-compat-example.png" />

<br/>

#### Review Score
**Options:**<br/>
`score` - The desired review score.
`type` - The desired review type to use, Metacritic or Steam.
`greater/less` - Wether to include apps that have a review score greater than or equal to the provided score, or less than or equal to it.
`greater/less` - Whether to include apps that have a review score greater than or equal to the provided score, or less than or equal to it.

**Behavior:**<br/>
Filters apps based on their review score.

**Example:**<br/>
<img title="Review Score Example" src="https://raw.githubusercontent.com/tormak9970/TabMaster/master/assets/docs_review-score-example.png" />
<img title="Review Score Example" src="https://raw.githubusercontent.com/tormak9970/TabMaster/master/assets/filters/docs_review-score-example.png" />

<br/>

#### Time Played
**Options:**<br/>
`play time` - The desired amount of time in the selected interval.
`time interval` - The time interval to use, "minutes", "hours", or "days".
`greater/less` - Wether to include apps that are greater than or equal to the provided score, or less than or equal to it.
`greater/less` - Whether to include apps that are greater than or equal to the provided score, or less than or equal to it.

**Behavior:**<br/>
Filters apps based on your time spent playing them.

**Example:**<br/>
<img title="Time Played Example" src="https://raw.githubusercontent.com/tormak9970/TabMaster/master/assets/docs_time-played-example.png" />
<img title="Time Played Example" src="https://raw.githubusercontent.com/tormak9970/TabMaster/master/assets/filters/docs_time-played-example.png" />

<br/>

#### Size on Disk
**Options:**<br/>
`size` - The desired size of apps to include.
`greater/less` - Wether to include apps that are greater than or equal to the provided score, or less than or equal to it.
`greater/less` - Whether to include apps that are greater than or equal to the provided score, or less than or equal to it.

**Behavior:**<br/>
Filters apps based on their size.

**Example:**<br/>
<img title="Size on Disk Example" src="https://raw.githubusercontent.com/tormak9970/TabMaster/master/assets/docs_size-on-disk-example.png" />
<img title="Size on Disk Example" src="https://raw.githubusercontent.com/tormak9970/TabMaster/master/assets/filters/docs_size-on-disk-example.png" />

<br/>

#### Release Date
**Options:**<br/>
`date` - The desired release date of apps to include.
`time period` - Whether you want to specify only the year, just the month and year, or the day, month, and year.
`before/after` - Wether to include apps that were released before or after the provided date.
`before/after` - Whether to include apps that were released before or after the provided date.

**Behavior:**<br/>
Filters apps based on their release date.

**Example:**<br/>
<img title="Release Date Example" src="https://raw.githubusercontent.com/tormak9970/TabMaster/master/assets/docs_release-date-example.png" />
<img title="Release Date Example" src="https://raw.githubusercontent.com/tormak9970/TabMaster/master/assets/filters/docs_release-date-example.png" />

<br/>

#### Last Played
**Options:**<br/>
`date` - The desired last played date of apps to include.
`time period` - Whether you want to specify only the year, just the month and year, or the day, month, and year.
`before/after` - Wether to include apps that were last played before or after the provided date.
`before/after` - Whether to include apps that were last played before or after the provided date.

**Behavior:**<br/>
Filters apps based on when they were last played.

**Example:**<br/>
<img title="Last Played Example" src="https://raw.githubusercontent.com/tormak9970/TabMaster/master/assets/docs_last-played-example.png" />
<img title="Last Played Example" src="https://raw.githubusercontent.com/tormak9970/TabMaster/master/assets/filters/docs_last-played-example.png" />

<br/>

Expand All @@ -256,7 +258,7 @@ Filters apps based on when they were last played.
Filters apps based on if they are a demo or not.

**Example:**<br/>
<img title="Demo Example" src="https://raw.githubusercontent.com/tormak9970/TabMaster/master/assets/docs_demo-example.png" />
<img title="Demo Example" src="https://raw.githubusercontent.com/tormak9970/TabMaster/master/assets/filters/docs_demo-example.png" />

<br/>

Expand All @@ -268,7 +270,35 @@ Filters apps based on if they are a demo or not.
Filters apps based on if they can be streamed or not.

**Example:**<br/>
<img title="Streamable Example" src="https://raw.githubusercontent.com/tormak9970/TabMaster/master/assets/docs_streamable-example.png" />
<img title="Streamable Example" src="https://raw.githubusercontent.com/tormak9970/TabMaster/master/assets/filters/docs_streamable-example.png" />

<br/>

#### Steam Features
**Options:**<br/>
`features` - A list of Steam features.
`logic mode` - Specifies whether to use `and` vs. `or` mode.
`inverted` - If true, inverts the filtered apps (exclued apps are now included, and vis versa).

**Behavior:**<br/>
- `and`: Filters apps based on if they have all listed features.
- `or`: Filters apps based on if they have any listed features.

**Example:**<br/>
<img title="Steam Features Example" src="https://raw.githubusercontent.com/tormak9970/TabMaster/master/assets/filters/docs_steam-features-example.png" />

<br/>

#### MicroSD Card (Requires MicroSDeck)
**Options:**<br/>
`MicroSD card` - The MicroSD card to use (if none are showing up, make sure they are showing up in MicroSDeck).
`inverted` - If true, inverts the filtered apps (exclued apps are now included, and vis versa).

**Behavior:**<br/>
Filters apps based on if they are installed on the specified MicroSD card.

**Example:**<br/>
<img title="MicroSD Card Example" src="https://raw.githubusercontent.com/tormak9970/TabMaster/master/assets/filters/docs_microsd-card-example.png" />

<br/>

Expand Down
2 changes: 2 additions & 0 deletions defaults/docs/Overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ These docs serve as a reference for questions you may have, and a guide for help
* What is a tab, parts of a tab, and default vs custom.
* Filters
* What are filters, descriptions/tips for each, and examples.
* Tab Profiles
* User made groups of tabs that can be swapped out on the fly.
* The Fix System
* TabMaster's system for handling changes that could potentially break it.

Expand Down
58 changes: 58 additions & 0 deletions defaults/docs/Tab_Profiles.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
## Tab Profiles

### Table of Contents
- Overview
- The Tab Profiles Context Menu
- Creating Profiles
- Applying Profiles
- Overwriting Profiles
- Deleting Profiles

<br/>


### Overview
Here you can find everything about Tab Profiles, including adding, applying, overwriting, and deleting them. To get started, use the button pictured below or the TabMaster context menu to open the Tab Profiles Menu.

<img title="Managing Tab Profiles" src="https://raw.githubusercontent.com/tormak9970/TabMaster/master/assets/docs_managing-tab-profiles.png" />

<br/>


### The Tab Profiles Context Menu
<img title="Tab Profiles Context Menu" src="https://raw.githubusercontent.com/tormak9970/TabMaster/master/assets/tab-profiles/docs_tab-profiles-context-menu.png" />
<br/>
The Tab Profiles context menu is where you can manage your profiles. You can create new ones, and apply, overwrite, and delete existing profiles from here.

<br/>


### Creating Profiles
<img title="Creating Tab Profiles" src="https://raw.githubusercontent.com/tormak9970/TabMaster/master/assets/tab-profiles/docs_creating-tab-profiles.png" />
<br/>
Creating profiles is straightforward. First, ensure that the tabs you want included in the profile are all visible, then open the Tab Profiles context menu using one of the two methods mentioned above. Click "Create Profile", entire a name, and the profile will be created.

<br/>


### Applying Profiles
Overwriting a profile is easy! Just open the Tab Profiles menu, and navigate to the profile you want to apply. Click "A", and the profile will be applied, showing all tabs in the profile, and hiding any that aren't.

<br/>


### Overwriting Profiles
<img title="Overwriting Tab Profiles" src="https://raw.githubusercontent.com/tormak9970/TabMaster/master/assets/tab-profiles/docs_coverwriting-tab-profiles.png" />
<br/>
Made a mistake while making a profile, or just decide something needed to change? Well its easy to overwrite profiles, just open the profiles menu and navigate to the profile you want to delete and click "Y". A window will show up comparing what's in the profile, to what you're overwriting it with, allowing you to see the changes that will be made. Simply confirm here, and the profile will be overwritten.

<br/>


### Deleting Profiles
Decide you don't like a profile anymore? Well deleting it is easy too! Just open the same Tab Profiles menu, and navigate to the profile you want to delete and click "X". You will be prompted to confirm if you really want to delete the profile, and confirming will delete it.

<br/>


###### © Travis Lane (Tormak), Jessebofill
2 changes: 2 additions & 0 deletions defaults/docs/Tabs.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ This is where you can add new tabs to your library. You can find the various opt

**Include** - The types of apps to include (defaults to games).

**Auto Hide** - Whether this tab should automatically be hidden from the library when it has no games (this preserves the order of the tabs, unlike hiding it manually).

**Logic Mode** - Two modes, `And` (apps must match all filters) and `Or` (apps must match at least one filter).

**Filters** - The filters for this tab. More details on these can be found on the next page.
Expand Down
20 changes: 19 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,14 +147,28 @@ async def get_friends_games(self) -> dict[int, list[int]] | None:
friends_games = Plugin.users_dict[Plugin.user_id]["friendsGames"]
log(f"Got {len(friends_games)} friendsGames")
return friends_games or {}

async def get_tab_profiles(self) -> dict[str, list[str]] | None:
"""
Waits until users_dict is loaded, then returns the tab profiles
:return: User's tab profiles
"""
while Plugin.users_dict is None:
await asyncio.sleep(0.1)

user = Plugin.users_dict[Plugin.user_id]
tab_profiles = Plugin.users_dict[Plugin.user_id]["tabProfiles"] if "tabProfiles" in user.keys() else {}
log(f"Got tab profiles {tab_profiles}")
return tab_profiles

# Plugin settings setters
async def set_tabs(self, tabs: dict[str, dict]):
Plugin.users_dict[Plugin.user_id]["tabs"] = tabs
await Plugin.set_setting(self, "usersDict", Plugin.users_dict)

async def set_tags(self, tags: list[dict]):
Plugin.tags= tags
Plugin.tags = tags
await Plugin.set_setting(self, "tags", Plugin.tags)

async def set_friends(self, friends: list[dict]):
Expand All @@ -165,6 +179,10 @@ async def set_friends_games(self, friends_games: dict[str, list[int]]):
Plugin.users_dict[Plugin.user_id]["friendsGames"] = friends_games
await Plugin.set_setting(self, "usersDict", Plugin.users_dict)

async def set_tab_profiles(self, tab_profiles: dict[str, list[str]]):
Plugin.users_dict[Plugin.user_id]["tabProfiles"] = tab_profiles
await Plugin.set_setting(self, "usersDict", Plugin.users_dict)

async def get_docs(self):
for docsFileName in os.listdir(self.docsDirPath):
with open(os.path.join(self.docsDirPath, docsFileName), 'r') as docFile:
Expand Down
Loading

0 comments on commit 2ac43da

Please sign in to comment.