Playnite Forums
  • Playnite Web
  • Rules
  • Members
  • Team
  • Search
  • Register
  • Login
  • Home
  • Members
  • Help
  • Search
Playnite Forums Extension Database Generic Extensions DuplicateHider - Hide Duplicate Game Copies

DuplicateHider - Hide Duplicate Game Copies
felixkmh
Offline

#1
06-22-2020, 07:08 PM (This post was last modified: 05-02-2022, 10:24 PM by felixkmh.)
This plugin tries to hide duplicate copies of games based on a modified version of their name (because copies of the same game can have different names, this does not always work perfectly). Only the copy with the highest priority stays visible if the "Hide Duplicates" function is invoked. The priority is based on the order of the source names in the plugin settings section, which can be re-ordered by using the arrows or by dragging the entries according to preference. The higher in the list a source is, the higher its priority. Installed games always have a higher priority than uninstalled games.

You can enable the UI Integration option to display a toggle button next to the play button if it has copies. Note that this feature might not work with every custom theme. Here is an example using the Default theme:

[Image: Playbutton-Extension.png]

Settings:
  • Priorites: Source names ordered by their priority. Highest priority at the top. Can be re-ordered using the arrows or by dragging the entries onto the desired position.
  • Update Rank Automatically: If enabled, duplicates will be hidden when Playnite opens and whenever a game is changed, added or removed, ensuring that only the game with the highest priority stays visible. If disabled, the "Hide Duplicates" and "Reveal Duplicates" extension functions have to be invoked manually after any changes to games or settings.
  • Show Copies in Game Menu: If enabled, right clicking a game will show a "Other copies" entry which contains all other (hidden) copies of the currently selected game. Clicking on the other copies will attempt to launch them using Playnite.
  • Included Platforms: Only games with platforms enabled in this setting are considered when looking for duplicates. By clicking the down arrow in the text box, a list of all available platforms is revealed. Only checked platforms are enabled. You can also type in the text box to search for a specific platform you want to enable/disable. Only "PC" and "Undefined" are enabled by default.
  • Exluded Sources: Games form sources enabled in this setting are ingored when looking for duplicates. By clicking the down arrow in the text box, a list of all available sources is revealed. Only checked sources are enabled. You can also type in the text box to search for a specific source you want to enable/disable. None are enabled by default.
  • Exluded Categories: Similar to Exluded Sources, but excludes enabled categories.
  • Ignored Games: A list of games manually put onto a ignore list using the "Add Selected Games to Ignore List" extension function. Games on this list are not considered when looking for duplicates. Select one or more entries to remove them from the list by right clicking and then clicking "Remove Entry". You can also remove games from this list using the "Remove Selected Games from Ignore List" extension function.
  • Display string for other copies: String used to display other copies in the game menu, when enabled. Right click to insert placeholder variables. Conditional text can be added before and after the variable name: {Prefix'Variable'Suffix}. Prefix and Suffix will only be visible if Variable can be evaluated.
  • Custom Replacement Rule: String replacement rules that matches the left side with a part of a game name and replaces it with the right side. The left side can be interpreted as a regular expression if the checkbox next to "Regex" is checked.
  • Enable UI Integration: If enabled, DuplicateHider will try to add an extra button next to the play button to start and install other copies of a game. Might not work with every custom theme.

Drag-and-Drop the .pext file onto the Playnite window to install.

GitHub

Help translate: https://crowdin.com/project/duplicatehider

[Image: localized.svg]

[Image: 61e11d430afb112ea33c3aa5_Button-1-p-500.png]

Contributions:
Translation:
Portuguese, Brazilian: ferrell
French: ohkami, Lacro59
Dutch: WaelALR, wout25
Spanish: darklinkpower
Polish: luniewski

Change log:
v3.0.0:
  • Playnite 9 Beta Support, not compatible with Playnite 8
  • Custom UI Support, used in a showcase theme as an example: DH_Night, Forum Post
  • Addon-Id changed, so the extension needs to be uninstalled before installing the new one

v2.5.4:
.pext   DuplicateHider_2_5_4.pext (Size: 78.03 KB / Downloads: 1,544)
  • updated to QuickSearchSDK 1.3
  • added settings to QuickSearch
  • added new option to sort by release date if source scores are equal
v2.5.3:
.pext   DuplicateHider_2_5_3.pext (Size: 83.81 KB / Downloads: 340)
  • updated to QuickSearchSDK 1.2
v2.5.2:
.pext   DuplicateHider_2_5_2.pext (Size: 95.08 KB / Downloads: 179)
  • updated to QuickSearchSDK 1.1
v2.5.1:
.pext   DuplicateHider_2_5_1.pext (Size: 80.61 KB / Downloads: 192)
  • Added support for QuickSearch extension.
v2.5.0:
.pext   DuplicateHider_2_5_0.pext (Size: 68.68 KB / Downloads: 321)
  • Added option to add toggle button next to play button to launch / install other copies of a game (might not work as expected with every theme)
  • Added option to define custom string replacement rules that are applied to game names before further processing
    • optionally: left side of rule can be intepreted as a regular expression if checkbox is checked.
v2.3.2:
.pext   DuplicateHider_2_3_2.pext (Size: 56.91 KB / Downloads: 719)
  • fixed extension crashing when game names contained numbers outside int32 range
v2.3.1:
.pext   DuplicateHider_2_3_1.pext (Size: 56.51 KB / Downloads: 239)
  • Added support for ExtensionUpdater to check for new versions.
v2.3.0:
.pext   DuplicateHider_2_3_0.pext (Size: 56.44 KB / Downloads: 209)
  • Added new option for "Ignore List": "Add manually hidden/revealed Games". If enabled, when the visibility of a game is changed by something other than DuplicateHider, the game is added to the Ignore List. This way DuplicateHider does not override a game's visibibilty which prevented the user from hiding games that have duplicates.
v2.2.5:
.pext   DuplicateHider_2_2_5.pext (Size: 56.99 KB / Downloads: 647)
  • Improved duplicate detection if game names contain roman numerals in one copy and arabic numerals in another
v2.2.4:
.pext   DuplicateHider_2_2_4.pext (Size: 55.93 KB / Downloads: 228)
  • Added more symbols to the special character filter to improve duplicate detection
  • some small UI improvements
v2.2.3:
.pext   DuplicateHider_2_2_3.pext (Size: 58.25 KB / Downloads: 292)
  • Fixed Priorities list not being saved/loaded correctly.
v2.2.2:
.pext   DuplicateHider_2_2_2.pext (Size: 49.41 KB / Downloads: 283)
  • Fixed game not being automatically revealed if only one copy is left after removing another copy (Only if Update Rank Automatically is enabled)
v2.2.1:
.pext   DuplicateHider_2_2_1.pext (Size: 50.65 KB / Downloads: 255)
  • Display string can have a conditional prefix and/or suffix in this format: {Prefix'Variable'Suffix}. The prefix and suffix are only shown if the variable exists. E.g. {ROM: 'ImageNameNoExt} will evaluate to "ROM: MyRom" if an image file with the name "MyRom" exists, otherwise it will evaluate to the empty string.
v2.2:
.pext   DuplicateHider_2_2.pext (Size: 47.64 KB / Downloads: 220)
  • Added customizable display string to plugin settings. Right-click to insert placeholder varaibles
v2.1:
.pext   DuplicateHider_2_1.pext (Size: 45.98 KB / Downloads: 272)
  • Added option to show other copies of a game in a game's context menu (Game Menu)
v2.0.1:
.pext   DuplicateHider_2_0_1.pext (Size: 44.41 KB / Downloads: 231)
  • Fixed default settings not being applied
  • Fixed Priority list not being populated
v2.0:
.pext   DuplicateHider_2_0.pext (Size: 42.09 KB / Downloads: 256)
  • Ported script over to a full plugin
  • Added menu function to add/remove selected games from a ignore list, which will cause DuplicateHider to not consider them when looking for duplicates
  • Options moved to plugin settings menu
    • Priorites can be changed using the arrows or by dragging them to the desired position
    • Ignored games can be removed from the list by selecting one ore more entries and right-clicking them
    • Search function for Include/Exclude options
  • Old settings are not restored when updating from a version below 2.0
  • Old version needs to be uninstalled manually when updating from a version below 2.0, otherwise old menu functions will exist next to the new ones
v1.6:
.pext   DuplicateHider_1_6.pext (Size: 3.35 KB / Downloads: 360)
  • When UpdateAutomatically is enabled, priorities are also re-evaluated when a game is installed/uninstalled.
v1.5:
.pext   DuplicateHider_1_5.pext (Size: 3.24 KB / Downloads: 310)
  • Reminder: When updating, customized priority lists and exclusion lists will be overriden. Back it up before updating to restore it after the update
  • Moved configuration to extra json config file.
  • Config file can be opened via a new menu function.
  • Added option to automatically hide/reveal games when new games are added or when old ones are removed. This always keeps one copy visible, according to the priorities and include/exclude lists (disabled by default, set "UpdateAutomatically" to true in config.json to enable it).
v1.4:
.pext   DuplicateHider_1_4.pext (Size: 2.51 KB / Downloads: 369)
  • Reminder: When updating, customized priority lists and exclusion lists will be overriden. Back it up before updating to restore it after the update
  • Added "IncludePlatforms" list. Only platform specified in that list are considered when hiding duplicates. Defaulted to "PC" and "Undefined" (games without platform). (Addressing this issue)
v1.3:
.pext   DuplicateHider_1_3.pext (Size: 2.43 KB / Downloads: 260)
  • Reminder: When updating, customized priority lists will be overriden. Back it up before updating to restore it after the update
  • Added more sources to predefined priorities.
v1.2:
.pext   DuplicateHider_1_2.pext (Size: 2.42 KB / Downloads: 272)
  • Reminder: When updating, customized priority lists will be overriden. Back it up before updating to restore it after the update
  • added lists to exclude games in specific sources and games in specific categories from being hidden.
  • as suggested by darklinkpower:
    • added some string replacements to handle different kinds of "GOTY" tags in game names
    • added "Undefined" to Priorities list. Games without a source get the priority of "Undefined"
    • added "Rockstar Games" source to predefined priorities



.pext   DuplicateHider_1_6_Playnite8.pext (Size: 3.45 KB / Downloads: 492)
.pext   DuplicateHider_1_0.pext (Size: 1.57 KB / Downloads: 351)
.pext   DuplicateHider_1_1.pext (Size: 1.66 KB / Downloads: 331)
DonkeyOatay
Offline

#2
06-23-2020, 08:23 AM
Thanks a lot. I've already hidden all of the duplicates manually, so I wish this had been around when doing that, but I'll give it a go when I need it in future.
SaltySamurai
Offline

#3
06-23-2020, 06:52 PM (This post was last modified: 06-23-2020, 07:01 PM by SaltySamurai.)
Very nice, even better than the GOG solution I think

Ah, how do you alter the list?
"The priority is based on the order of the source names at the beginning of the script, which can be re-ordered according to preference." Where do I do that?
felixkmh
Offline

#4
06-23-2020, 08:46 PM (This post was last modified: 06-23-2020, 08:54 PM by felixkmh.)
(06-23-2020, 06:52 PM)SaltySamurai Wrote: Very nice, even better than the GOG solution I think

Ah, how do you alter the list?
"The priority is based on the order of the source names at the beginning of the script, which can be re-ordered according to preference." Where do I do that?
You should be able to find the script "DuplicateHider.py" at %APPDATA%\Playnite\Extensions\ inside a folder that begins with "DuplicateHider".
You can change the priorities by re-ordering the names in the Priorites list at the beginning of DuplicateHider.py:
Priorities = [
    "Steam",
    "GOG",
    "Epic",
    "Amazon",
    "Humble",
    "Twitch",
    "Xbox",
    "Uplay",
    "Origin",
    "Battle.net",
]
Here, steam has the highest priority. Just keep in mind that a game installed on GOG would still have a higher priority than a game not installed on Steam in this case. If both were installed or not installed, the Steam version would be prioritized.
If you are using other sources, you can also add them to that list.

And don't forget to reload the script after altering the list, otherwise it won't have an effect until the next time Playnite starts.
SaltySamurai
Offline

#5
06-23-2020, 09:45 PM
(06-23-2020, 08:46 PM)felixkmh Wrote:
(06-23-2020, 06:52 PM)SaltySamurai Wrote: Very nice, even better than the GOG solution I think

Ah, how do you alter the list?
"The priority is based on the order of the source names at the beginning of the script, which can be re-ordered according to preference." Where do I do that?
You should be able to find the script "DuplicateHider.py" at %APPDATA%\Playnite\Extensions\ inside a folder that begins with "DuplicateHider".
You can change the priorities by re-ordering the names in the Priorites list at the beginning of DuplicateHider.py:
Priorities = [
    "Steam",
    "GOG",
    "Epic",
    "Amazon",
    "Humble",
    "Twitch",
    "Xbox",
    "Uplay",
    "Origin",
    "Battle.net",
]
Here, steam has the highest priority. Just keep in mind that a game installed on GOG would still have a higher priority than a game not installed on Steam in this case. If both were installed or not installed, the Steam version would be prioritized.
If you are using other sources, you can also add them to that list.

And don't forget to reload the script after altering the list, otherwise it won't have an effect until the next time Playnite starts.

Awesome, thankyou. I want Uplay at the top of the list because games you buy on steam are played through Uplay anyway. Then again I am wondering if I really prefer that, might need to test both. I suppose I still get the steam Overlay if I use the steam version.
felixkmh
Offline

#6
06-24-2020, 06:13 AM (This post was last modified: 06-24-2020, 06:14 AM by felixkmh.)
If you want to play around with different priorities, just keep in mind that the "Hide Duplicates" function does not make any copy visible. So if you use it multiple times with different priorities, all copies of a game might end up being hidden. You can use the "Show All Duplicates" function to make all copies of games visible that have more than one copy before calling "Hide Duplicates" again with different priorities.
darklinkpower
Offline

Super Moderator
#7
07-02-2020, 04:40 PM (This post was last modified: 07-02-2020, 05:19 PM by darklinkpower.)
The extension is working great but I just found another replacement case to provide better results: replace 'Game of the Year' for "GOTY" for cases like these.



[Image: nfsuBHo.png]



The only trouble there would be the 'Edition'. Perhaps it should be removed altogether for the comparison? I don't think there should be any issues. This game is affected by this too.



[Image: ni1t9Ys.png]



I added these changes to your script, only issue I found after the change was this:
[Image: G9Dj7Bs.png]

Adding the lower() method before the replacing fixed the issue and I just added
.replace('game of the year', "goty").replace('edition', "") to the replacing.

----------------------------------------------------

Another issue is that for some reason the numbers are not matching what has been hidden/showed

[Image: rwNmxLq.png]

[Image: TpJioeG.png]

[Image: jmdwZzO.png]
felixkmh
Offline

#8
07-03-2020, 12:24 AM (This post was last modified: 07-03-2020, 12:36 AM by felixkmh.)
Thanks for the input. That sound like a sensible addition. I will add something like that to get around the "goty" issue. For the other issue with the numbers not matching up, I don't know what could be causing that besides some games that are being hidden are inside your z_Hide category without being marked as "Hidden" before invoking the "Hide All Duplicates" function. Only games that are visible before are set to "hidden" and only those increase the count. If that's not the cause, there must be something else that I am entirely unaware of.

If you want to see which games are being hidden, add this to the end of the "hide_duplicates(args)" function (or "unhide_duplicates(args)").

    # Save list to file
    s = "\n".join([str((game.Name, ", ".join(
        [c.Name for c in game.Categories]) if game.Categories is not None else "None")) for game in updates])
    path = PlayniteApi.Dialogs.SaveFile("Text file|*.txt")
    if (path is not None and path != ""):
        with open(path, "w") as file:
            file.write(s)

This will prompt you to save a text file containing a list of all games that were hidden and their categories when "Hide All Duplicates" is executed.
darklinkpower
Offline

Super Moderator
#9
07-03-2020, 01:12 AM (This post was last modified: 07-03-2020, 07:20 AM by darklinkpower.)
Thanks, this helped me find the issue! One example:

[Image: H3N4vkW.png]

I had only PC games filtered so I didn't see this. It turns out it's hiding emulated games, which often have the same name for different platforms (and they could be the same game or not). Simply filtering the database for PC games will solve this, since there are not issues with game duplicates in emulated games.

I was also wondering if you could add some extra platforms by default to the priority list: default playnite/no plugin, itch.io and Rockstar library
sunday_mf
Offline

#10
10-04-2020, 04:58 AM
This is one of the most useful extensions. Thank you for your product!
Pretzel
Offline

#11
10-15-2020, 04:28 AM
Are you going to update for 8.0 anytime soon?
felixkmh
Offline

#12
10-15-2020, 05:50 AM
(10-15-2020, 04:28 AM)Pretzel Wrote: Are you going to update for 8.0 anytime soon?

Just made the necessary changes and uploaded a version that should be compatible with Playnite 8.
strider820
Offline

#13
10-19-2020, 06:15 AM
(10-15-2020, 05:50 AM)felixkmh Wrote:
(10-15-2020, 04:28 AM)Pretzel Wrote: Are you going to update for 8.0 anytime soon?

Just made the necessary changes and uploaded a version that should be compatible with Playnite 8.

I'm having a problem with the setting menu not having anything in the priorities list. Am I missing something?
felixkmh
Offline

#14
10-19-2020, 07:04 AM (This post was last modified: 10-19-2020, 11:14 AM by felixkmh.)
(10-19-2020, 06:15 AM)strider820 Wrote: I'm having a problem with the setting menu not having anything in the priorities list. Am I missing something?

I'm not sure why that would happen, but I made some changes that sould definitely populate the priorities list with all available sources. Let me know if this version fixed that issue for you.
hestoyjarto
Offline

#15
10-23-2020, 09:40 AM (This post was last modified: 10-23-2020, 09:52 AM by hestoyjarto.)
Hi! Thanks for this extension.

Location file to change priority has changed with new version. You should notify that new json config file now is located under extenstion data folder link.
Most important! Extension doesn't work with playstation platform. I see all its duplicated games :-( I couldn't make it work with adding Playstation lines to json config file :S
felixkmh
Offline

#16
10-23-2020, 09:57 AM (This post was last modified: 10-23-2020, 10:30 AM by felixkmh.)
(10-23-2020, 09:40 AM)hestoyjarto Wrote: Hi! Thanks for this extension.

I can't find duplicateHider.py to change priority. Has it changed with new version?
Most important! Extension doesn't work with playstation platform. I see all its duplicated games :-(

Hi hestoyjarto,

yeah, since version 2.0 the settings have moved into the "Plugins" section of the playnite settings. I forgot to update the Plugin description, sorry about that.
Also, by default only PC games and games without a platform attached to them are considered when hiding duplicates. You can enable it in the plugin settings as well by checking the desired platform under "Included Platforms". You can use the text box to search for available platforms and then enable them by checking the checkbox. If you had a version below 2.0 installed previously, you should also remove or disable that if you want to use the newer version, because otherwise you get duplicate entries in the extension menu.
I will update the description as well to better reflect the current state of this plugin.

[Image: Settings.png]
badleo
Offline

#17
10-25-2020, 08:20 PM
felixkmh, Thanks a lot! It is almost perfect to me!
But I got one problem, I don't know which copy of them, 
is it possible to have a options to show roms file name here?

Thank you!

[Image: Fx6pNcV.png]
felixkmh
Offline

#18
10-25-2020, 10:10 PM
Hi badleo,

I just uploaded a new version which allows you to customize what the other copie's entries look like. You can edit the string at the bottom of the plugin settings. You can insert the available placeholders by right-clicking the text box at the position where you want to insert it. In your case you probably want to add either "{ImageNameNoExt}" or "{ImageName}", which gets replaced by the file name of the rom/image of a game, if it exists.
badleo
Offline

#19
10-26-2020, 02:14 AM
(10-25-2020, 10:10 PM)felixkmh Wrote: Hi badleo,

I just uploaded a new version which allows you to customize what the other copie's entries look like. You can edit the string at the bottom of the plugin settings. You can insert the available placeholders by right-clicking the text box at the position where you want to insert it. In your case you probably want to add either "{ImageNameNoExt}" or "{ImageName}", which gets replaced by the file name of the rom/image of a game, if it exists.

It work like a charm! Thanks again!

[Image: G30wRDQ.png]
masytan
Offline

#20
10-26-2020, 12:30 PM
This is excellent, thank you very much.
« Next Oldest | Next Newest »
Pages (7): 1 2 3 4 5 … 7 Next »
Jump to page 



  • View a Printable Version
  • Subscribe to this thread

© Designed by D&D - Powered by MyBB

Linear Mode
Threaded Mode