Skip to content

Commit a833658

Browse files
committed
wip
1 parent 3947287 commit a833658

File tree

5 files changed

+11
-162
lines changed

5 files changed

+11
-162
lines changed

Jellyfin.Plugin.Streamyfin/Configuration/config.html

+2-40
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,11 @@ <h2 class="sectionTitle">Streamyfin</h2>
3232

3333
<div id="yamleditor" style="width: 800px; height: 600px; border: 0px solid grey"></div>
3434

35-
<!-- <div id="yaml-editor"></div> -->
3635

3736
</div>
3837
<script id="hljs" async
3938
src="https://unpkg.com/@skrashevich/[email protected]/dist/monaco-editor.bundle.js"></script>
4039

41-
<!-- <script type="module" async src="configurationpage?name=config.js"></script> -->
4240
<script>
4341
const Streamyfin = {
4442
pluginId: "1e9e5d38-6e67-4615-8719-e98a5c34f004",
@@ -51,25 +49,20 @@ <h2 class="sectionTitle">Streamyfin</h2>
5149
Value: editor.getModel().getValue()
5250
};
5351

54-
//alert(window.editor.getModel().getValue());
5552
const url = window.ApiClient.getUrl('streamyfin/config/yaml');
5653
const data = JSON.stringify(config);
57-
//console.log(data);
58-
//window.ApiClient.getPluginConfiguration(Streamyfin.pluginId)
54+
5955
window.ApiClient.ajax({ type: 'POST', url, data, contentType: 'application/json' })
6056
.then(function (response) {
6157
response.json().then(res => {
6258
if (res.Error == true) {
6359
Dashboard.hideLoadingMsg();
6460
Dashboard.alert(res.Message);
65-
//response.statusText = res.Message;
66-
//Dashboard.processErrorResponse(response);
6761
} else {
6862
Dashboard.processPluginConfigurationUpdateResult();
6963
}
7064
})
7165
}
72-
//processErrorResponse
7366

7467
)
7568
.catch(function (error) {
@@ -84,17 +77,10 @@ <h2 class="sectionTitle">Streamyfin</h2>
8477
loadConfig: function () {
8578
Dashboard.showLoadingMsg();
8679
const url = window.ApiClient.getUrl('streamyfin/config/yaml');
87-
//window.ApiClient.getPluginConfiguration(Streamyfin.pluginId)
8880
window.ApiClient.ajax({ type: 'GET', url, contentType: 'application/json' })
8981
.then(function (response) {
9082
response.json().then(res => {
9183
const yamlModelUri = monaco.Uri.parse('streamyfin.yaml');
92-
//monaco.value = "hello";
93-
//console.log(res);
94-
//console.log(config.Yaml);
95-
//const data = JSON.stringify({ Username: username, Password: password });
96-
//const yaml = window.ApiClient.getUrl('streamyfin/config/yaml');
97-
//editor.getModel().setValue(res.Value);
9884
Streamyfin.editor = monaco.editor.create(document.getElementById('yamleditor'), {
9985
automaticLayout: true,
10086
language: 'yaml',
@@ -106,10 +92,6 @@ <h2 class="sectionTitle">Streamyfin</h2>
10692
model: monaco.editor.createModel(res.Value, 'yaml', yamlModelUri),
10793
});
10894
})
109-
//console.log(config);
110-
//for (let i = 0; i < config.ImportSets.length; i++) {
111-
// CollectionImport.addSet(config.ImportSets[i]);
112-
// }
11395
})
11496
.catch(function (error) {
11597
console.error(error);
@@ -119,10 +101,7 @@ <h2 class="sectionTitle">Streamyfin</h2>
119101
});
120102
},
121103
init: function () {
122-
123104
monaco.editor.setTheme('vs-dark');
124-
125-
126105
const monaco_yaml = monacoYaml.configureMonacoYaml(monaco, {
127106
enableSchemaRequest: true,
128107
hover: true,
@@ -136,34 +115,17 @@ <h2 class="sectionTitle">Streamyfin</h2>
136115
},
137116
],
138117
});
139-
//alert("yo");
140118
console.log("init");
141119
Streamyfin.loadConfig();
142120
Streamyfin.btnSave.addEventListener("click", Streamyfin.saveConfig);
143121
}
144122
}
145-
//Streamyfin.init();
146-
//});
147-
//}
123+
148124
function waitForScript() {
149125
if (typeof monaco === "undefined") {
150-
// Retry every 50ms
151-
console.log("waiting");
152-
// try {
153-
// console.log(monaco);
154-
// } catch (error) {
155-
// }
156-
// try {
157-
// console.log(Streamyfin);
158-
// } catch (error) {
159-
// }
160-
161126
setTimeout(waitForScript, 50);
162127
} else {
163-
// console.log("loaded");
164-
//if (typeof Streamyfin !== 'undefined') {
165128
Streamyfin.init();
166-
// }
167129
}
168130
}
169131
waitForScript();

Jellyfin.Plugin.Streamyfin/Configuration/config.js

-113
This file was deleted.

Jellyfin.Plugin.Streamyfin/Jellyfin.Plugin.Streamyfin.csproj

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
<PropertyGroup>
33
<TargetFramework>net8.0</TargetFramework>
44
<RootNamespace>Jellyfin.Plugin.Streamyfin</RootNamespace>
5-
<AssemblyVersion>0.21</AssemblyVersion>
6-
<FileVersion>0.21</FileVersion>
5+
<AssemblyVersion>0.22</AssemblyVersion>
6+
<FileVersion>0.22</FileVersion>
77
<GenerateDocumentationFile>true</GenerateDocumentationFile>
88
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
99
<Nullable>enable</Nullable>
@@ -34,7 +34,7 @@
3434

3535
<ItemGroup>
3636
<EmbeddedResource Include="Configuration\config.html" />
37-
<EmbeddedResource Include="Configuration\config.js" />
37+
<!-- <EmbeddedResource Include="Configuration\config.js" /> -->
3838
</ItemGroup>
3939

4040
</Project>

Jellyfin.Plugin.Streamyfin/Plugin.cs

+5-5
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@ public IEnumerable<PluginPageInfo> GetPages()
4545
EmbeddedResourcePath = prefix + ".Configuration.config.html",
4646
};
4747

48-
yield return new PluginPageInfo
49-
{
50-
Name = "config.js",
51-
EmbeddedResourcePath = prefix + ".Configuration.config.js"
52-
};
48+
// yield return new PluginPageInfo
49+
// {
50+
// Name = "config.js",
51+
// EmbeddedResourcePath = prefix + ".Configuration.config.js"
52+
// };
5353
}
5454
}

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export VERSION := 0.21
1+
export VERSION := 0.22
22
export GITHUB_REPO := lostb1t/jellyfin-plugin-streamyfin
33
export FILE := streamyfin-${VERSION}.zip
44

0 commit comments

Comments
 (0)