Kodi Community Forum

Full Version: New profile inherits master profile sources despite media sources/info=separate
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Just created a kids profile in which I wanted to scan a specific directory containing kid friendly content, but when creating the profile I can see everything that was available in the master profile. Is there any way to get what I want here?
(2020-08-10, 17:30)Phobios Wrote: [ -> ]but when creating the profile I can see everything that was available in the master profile. Is there any way to get what I want here?

Yes, you also have to select "start fresh" everywhere you have been asked for a decision. I'm using multiple profiles on my machines as well and selecting "separate" is not enough.
I actually did select "start fresh" everywhere, but I still get everything from master profile. Not sure what is wrong. Any config files I can double check?
It's one of the inherent weaknesses of how profiles are currently set up, and why this aspect of Kodi is in need of work.

What happens is that the master profile is always loaded first, and then any selected sub-profile is loaded afterwards. If you look in the debug log (wiki) for example for a configuration that has an advancedsettings.xml (wiki) file for both the master and the sub-profile, you will see both being loaded in turn (master first, then sub-profile).

It's easier to think of the "master" profile as being the "generic" one, which is loaded every time no matter what. If you want the profiles to be truly independent, then only put anything that you want every profile to have in the master profile (or just leave it empty) and then set up independent sub-profiles for each usage case (kids, adults etc).
Well, I'm using profiles since ever and I have different sources for them without any problems. I most likely use one profile for my already scraped movies (local nfos) and another profile with another source for those movies I would like to scrape. Each profile will have its own separated database in its userdata folder (or in the "profiles/<name_of_profile>"-folder for the specific profile). 

The only usecase I could think of where an advancedsettings.xml might confuse profiles is, if there's a MySQL database in use. Using profiles with a MySQL which has different content requires a different database inside that MySQL instance. Therefore the <name>name_of_db</name>-tag can be used for MySQL DBs. So every profile can be pointed to its own MySQL DB and can be used on different Kodi clients (tested with a MySQL installed on a Pi in my network and different Kodi clients with different profiles to share whatched-states between Kodi clients and profiles). 

See: https://kodi.wiki/view/Advancedsettings....eodatabase

But I guess that's not the case in here or the OP forget to mention that.
 
(2020-09-19, 17:33)DarrenHill Wrote: [ -> ]What happens is that the master profile is always loaded first, and then any selected sub-profile is loaded afterwards. If you look in the debug log (wiki) for example for a configuration that has an advancedsettings.xml (wiki) file for both the master and the sub-profile, you will see both being loaded in turn (master first, then sub-profile).

That's not 100% true (or I might have misunderstood). Only if you are using a login-screen at startup, then the master-advancedsettings.xml is loaded ALWAYS!!! No other advancedsettings.xml is loaded then. And if you then select the other profile, then the other profile-advancedsettings is loaded. But Kodi does not load every advancedsettings.xml from every profile on startup. You can also observe that if you enable debug logging for the master profile but not for the 2nd profile in use. If you are at the login-screen, there's always the log-overlay shown. But if you then select the 2nd profile (where debug logging is disabled) that overlay is gone as Kodi loads another guisettings.xml then and overwirtes what exists before. But while using the login-screen, the master-guisettings and master-advancedsettings are loaded. But ....

That won't happen if you don't setup a login-screen on startup and let Kodi load the last-used profile. Then, only the advancedsettings.xml of that last-used profile is loaded. But anyway...beside using a mysql DB, the advancedsettings should not have any effect of separating databases. I just can tell that I'm using that since XBMC without any problems. 

This is how the log looks like if I let Kodi load the master profile as "last-used"-profile:
Code:
2020-09-19 18:25:20.004 T:14265    INFO <general>: Contents of special://profile/advancedsettings.xml are...
                                                   <advancedsettings>
                                                     <videolibrary>
                                                       <recentlyaddeditems>20</recentlyaddeditems>
                                                     </videolibrary>
                                                   </advancedsettings>

This is how it looks for the other profile:
Code:
2020-09-19 18:34:01.588 T:14776    INFO <general>: Contents of special://profile/advancedsettings.xml are...
                                                   <advancedsettings>
                                                     <videolibrary>
                                                       <recentlyaddeditems>35</recentlyaddeditems>
                                                     </videolibrary>
                                                   </advancedsettings>

See "20" to "35" for recentlyaddeditems.

And only one of each is loaded. Beside I switch the profile. Then the log will show that another one is loaded. But that does not mean something is inherited. Because if I load the 2nd profile first (which has 35 recently added items) and I delete the advancedsettings.xml from my master profile before starting Kodi, the 2nd profile still shows 35 items. If I then swith to the master profile (which doesn't have any advancedsettings.xml anymore), the master profile shows the default for that setting (which is 25). 

So there's no inheritance beside you set that up while creating the profile. I'll add screenshots in the next posting
Those are the settings which are responsible for inheritance. If you don't want to inherit anything, set them to "separate". Possible options are "Separate", "Shares with default (read only)" and "Shares with default".
Image

Then don't forget to select this. Otherwise you will get the db of the master-profile.
Image
(2020-09-19, 15:37)Phobios Wrote: [ -> ]Any config files I can double check?
You could show screenshots from your current profile settings for both profiles

And, ofc, a Debug Log
Played around a bit more with profiles:

First test
Settings are: everything is set to "separate" at the first screenshot and I selected "Copy default" from the 2nd.

Result:
The 2nd profile will inherit the sources from the master profile without any "content". So if you then select "Update library" nothing happens as there's no content for that source set. If you set content to that source (movies for example), it will be added to the library.

profiles,xml:

Code:
<profiles>
    <lastloaded>0</lastloaded>
    <useloginscreen>false</useloginscreen>
    <autologin>-1</autologin>
    <nextIdProfile>4</nextIdProfile>
    <profile>
        <id>0</id>
        <name>Master user</name>
        <directory pathversion="1">special://masterprofile/</directory>
        <thumbnail pathversion="1"></thumbnail>
        <hasdatabases>true</hasdatabases>
        <canwritedatabases>true</canwritedatabases>
        <hassources>true</hassources>
        <canwritesources>true</canwritesources>
        <lockaddonmanager>false</lockaddonmanager>
        <locksettings>0</locksettings>
        <lockfiles>false</lockfiles>
        <lockmusic>false</lockmusic>
        <lockvideo>false</lockvideo>
        <lockpictures>false</lockpictures>
        <lockprograms>false</lockprograms>
        <lockgames>false</lockgames>
        <lockmode>0</lockmode>
        <lockcode></lockcode>
        <lastdate>09/19/2020 - 5:05 PM</lastdate>
    </profile>
    <profile>
        <id>3</id>
        <name>dfsg</name>
        <directory pathversion="1">profiles/dfsg/</directory>
        <thumbnail pathversion="1"></thumbnail>
        <hasdatabases>true</hasdatabases>
        <canwritedatabases>true</canwritedatabases>
        <hassources>true</hassources>
        <canwritesources>true</canwritesources>
        <lockaddonmanager>false</lockaddonmanager>
        <locksettings>0</locksettings>
        <lockfiles>false</lockfiles>
        <lockmusic>false</lockmusic>
        <lockvideo>false</lockvideo>
        <lockpictures>false</lockpictures>
        <lockprograms>false</lockprograms>
        <lockgames>false</lockgames>
        <lockmode>0</lockmode>
        <lockcode>-</lockcode>
        <lastdate></lastdate>
    </profile>
</profiles>

So, as you can see, both profiles have "hasdatabases" set to "true", which means, they still can have different sources and different content as they have different databases

2nd test

Settings are: everything is set to "Share from default" from the first screenshot and "Copy default" from the 2nd one (which only asks for the settings from the master profile and not for the sources anymore as that's already selected by chosing "Shares from default")..

Result:
The database is shared from default (the master profile) and the 2nd profile has the same content as the master profile has.

profiles.xml:
Code:
<profiles>
    <lastloaded>0</lastloaded>
    <useloginscreen>false</useloginscreen>
    <autologin>-1</autologin>
    <nextIdProfile>5</nextIdProfile>
    <profile>
        <id>0</id>
        <name>Master user</name>
        <directory pathversion="1">special://masterprofile/</directory>
        <thumbnail pathversion="1"></thumbnail>
        <hasdatabases>true</hasdatabases>
        <canwritedatabases>true</canwritedatabases>
        <hassources>true</hassources>
        <canwritesources>true</canwritesources>
        <lockaddonmanager>false</lockaddonmanager>
        <locksettings>0</locksettings>
        <lockfiles>false</lockfiles>
        <lockmusic>false</lockmusic>
        <lockvideo>false</lockvideo>
        <lockpictures>false</lockpictures>
        <lockprograms>false</lockprograms>
        <lockgames>false</lockgames>
        <lockmode>0</lockmode>
        <lockcode></lockcode>
        <lastdate>09/19/2020 - 5:13 PM</lastdate>
    </profile>
    <profile>
        <id>4</id>
        <name>asdfg</name>
        <directory pathversion="1">profiles/asdfg/</directory>
        <thumbnail pathversion="1"></thumbnail>
        <hasdatabases>false</hasdatabases>
        <canwritedatabases>true</canwritedatabases>
        <hassources>false</hassources>
        <canwritesources>true</canwritesources>
        <lockaddonmanager>false</lockaddonmanager>
        <locksettings>0</locksettings>
        <lockfiles>false</lockfiles>
        <lockmusic>false</lockmusic>
        <lockvideo>false</lockvideo>
        <lockpictures>false</lockpictures>
        <lockprograms>false</lockprograms>
        <lockgames>false</lockgames>
        <lockmode>0</lockmode>
        <lockcode>-</lockcode>
        <lastdate></lastdate>
    </profile>
</profiles>

As you can now see, the 2nd profile "asdfg" has "hasdatabases" set to "false". That means you are able to add another source, but that won't differ between the profiles as that profile now writes the content for the db to the "MyVideosyxz.db" file at the master profile. So no separated databases are possible.

So @Phobios please also show me the "profiles.xml" from your userdata folder (there's only a single file called "profiles.xml")
@DaVu - my meaning was exactly what you describe.

Before you get to the menu, the master profile is loaded. Then if you have profiles enabled, the settings for that profile are loaded. So in effect both the master and the selected profile are loaded in sequence. Hence it is quite possible that stuff from the master one can leak into the secondary profile that way. Hence why I suggest if profiles are to be used, that the master one is either not used at all or is used for stuff that will be common to all profiles.

It certainly happens with advancedsettings.xml (wiki) files, so could potentially do so with sources too by the same route.
(2020-09-19, 20:42)DarrenHill Wrote: [ -> ]It certainly happens with advancedsettings.xml (wiki) files, so could potentially do so with sources too by the same route.

Maybe there are circumstances, but I thought I showed above that this is not the case Wink

Maybe I'm able to reproduce at some time. I created about 10 different profile and deleted them, added sources, removed sources a bunch of time withtout restarting Kodi. So all in one Kodi session. No issues Wink
(2020-09-19, 20:42)DarrenHill Wrote: [ -> ]Then if you have profiles enabled, the settings for that profile are loaded.

But ^^ that's not the case. Maybe I missed if from the logs, but AFAICS the settings for another profile (beside the master profilte) is only loaded if you select that profile to be loaded. In the log there's only one section for advancedsettings shown until I switch to another profile. Then for sure, the profile switch is shown and also other settigns are loaded. But Kodi won't load 2 different kind of advancedsettings from the login screen. And furthermore, if you don't use a login screen, not even the master profile settings are loaded. Then only the settings for that specific profile is loaded. 

I'm on Linux. So maybe there's a bug for the OS you are using?!
After a little talk to Darren Wink I have to correct myself. 

If you have an advancedsettings.xml in your master profile and not at the 2nd profile (or a different one), then specific settings which aren't overwritten by the same setting with another value will survive. Same as for the keymaps. I thought advancedsettings are treated differently. My bad. At least if the login-screen is in use. If auto-login is in use, then it's handled differently on startup.

I never used an advancedsettings.xml on the master profile. That's why I haven't noticed that before.
I did use advancedsettings.xml on the master profile and a mysql server for the library. I guess this is where the issues come from then. I have now stopped using the master profile, and so far it works great. Thanks for the help!
You're welcome. I think we all learned something on this one Smile

Thread marked solved.