File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ with lib; let
99 inherit ( config . nixflix ) globals ;
1010 cfg = config . nixflix . jellyfin ;
1111 xml = import ./xml.nix { inherit lib ; } ;
12+ util = import ./util.nix { inherit lib ; } ;
1213
1314 networkXmlContent = xml . mkXmlContent "NetworkConfiguration" cfg . network ;
1415 brandingXmlContent = xml . mkXmlContent "BrandingOptions" cfg . branding ;
@@ -105,7 +106,7 @@ with lib; let
105106 } )
106107 ( nonDBOptions ++ [ "id" "internalId" ] ) ;
107108
108- dbColumns = map ( name : xml . toPascalCase name ) ( attrNames userAttrs ) ;
109+ dbColumns = map ( name : util . toPascalCase name ) ( attrNames userAttrs ) ;
109110 dbValues = map ( name : sqliteFormat name userAttrs . ${ name } ) ( attrNames userAttrs ) ;
110111 in ''
111112 userExists=$(${ sq } "SELECT 1 FROM Users WHERE Username = '${ username } '" 2>/dev/null || echo "")
@@ -127,7 +128,7 @@ with lib; let
127128 echo "UPDATE Users SET ${
128129 concatStringsSep ", " (
129130 map (
130- name : "${ xml . toPascalCase name } = ${ sqliteFormat name userAttrs . ${ name } } "
131+ name : "${ util . toPascalCase name } = ${ sqliteFormat name userAttrs . ${ name } } "
131132 ) ( attrNames userAttrs )
132133 )
133134 } WHERE Username = '${ username } ';" >> "$dbcmds"
Original file line number Diff line number Diff line change 1+ { lib , ...} :
2+ with lib ; {
3+ toPascalCase = str : let
4+ firstChar = substring 0 1 str ;
5+ rest = substring 1 ( - 1 ) str ;
6+ in
7+ ( toUpper firstChar ) + rest ;
8+ }
Original file line number Diff line number Diff line change 11{ lib , ...} :
22with lib ; let
3- toPascalCase = str : let
4- firstChar = substring 0 1 str ;
5- rest = substring 1 ( - 1 ) str ;
6- in
7- ( toUpper firstChar ) + rest ;
3+ util = import ./util.nix { inherit lib ; } ;
84
95 escapeXml = str :
106 builtins . replaceStrings
@@ -35,7 +31,7 @@ with lib; let
3531 else
3632 concatStringsSep "\n " (
3733 mapAttrsToList ( name : value : let
38- tagName = toPascalCase name ;
34+ tagName = util . toPascalCase name ;
3935 valueStr =
4036 if isBool value
4137 then
You can’t perform that action at this time.
0 commit comments