2024-01-22, 12:35 PM
(This post was last modified: 2024-01-22, 12:38 PM by Maxy TV. Edited 1 time in total.)
Let's break it down; I'll try to approach it differently and outline a workflow. I would appreciate it if you could confirm point by point whether each of them is possible or not, allowing me to assess options and possibilities with the resources I have.
0.1: The plugin is capable of creating a 'code' field to be filled in during user registration. I think this is not impossible since I have seen plugins that add checkboxes to Jellyfin. Similar to how values like True or False are stored in the database attribute for checking or unchecking the box, an alphanumeric value could also be entered into an attribute in the database table.
1. Within the plugin functions, there is a call to "PlayBackStart," which supposedly registers when a user hits play on a file.
2. The plugin can be designed to communicate with the external; specifically, it could notify an external process that user X has started playing a specific movie. Is that possible? Alternatively, upon receiving the user's click, it could execute a pre-existing script in the operating system to handle part of the work.
3. After receiving the user's playback notification, a program will be monitoring when this happens to call the script (if the plugin is unable to call the script after the play event occurs). This script will take care of retrieving the user's ID stored in the jellyfin.db database. I assume the notification will indicate which user performed the play action, allowing the script to find the code stored in that user's database.
4. Once we have identified the file and the code, the OS script could replace the content of .strm by modifying (and saving) the place where 'code' is located with the code obtained from the user. It would revert the changes within a few seconds, only needing the time it takes for the client to grab its link.
Now, Jellyfin should be able to play the .strm with the user's link. But of course, how do we ensure that Jellyfin takes the link with the modified code? Will Jellyfin take the unmodified link before the script can modify it?
5. For this to be possible, we would need to make Jellyfin wait 1 or 2 seconds to take the link from the strm file to ensure that the script has enough time to make the modification. If delaying the connection is not possible, another approach could be to provoke a retry of the connection after 1 or 2 seconds.
Thank you very much for all your help. If I achieve what I'm aiming for, it will be a very interesting project as it plans to integrate with Telegram's unlimited storage. This would result in almost negligible storage costs, with only the costs of hosting and running the Telegram bot (if the bot is implemented in the cloud) being necessary.
0.1: The plugin is capable of creating a 'code' field to be filled in during user registration. I think this is not impossible since I have seen plugins that add checkboxes to Jellyfin. Similar to how values like True or False are stored in the database attribute for checking or unchecking the box, an alphanumeric value could also be entered into an attribute in the database table.
1. Within the plugin functions, there is a call to "PlayBackStart," which supposedly registers when a user hits play on a file.
2. The plugin can be designed to communicate with the external; specifically, it could notify an external process that user X has started playing a specific movie. Is that possible? Alternatively, upon receiving the user's click, it could execute a pre-existing script in the operating system to handle part of the work.
3. After receiving the user's playback notification, a program will be monitoring when this happens to call the script (if the plugin is unable to call the script after the play event occurs). This script will take care of retrieving the user's ID stored in the jellyfin.db database. I assume the notification will indicate which user performed the play action, allowing the script to find the code stored in that user's database.
4. Once we have identified the file and the code, the OS script could replace the content of .strm by modifying (and saving) the place where 'code' is located with the code obtained from the user. It would revert the changes within a few seconds, only needing the time it takes for the client to grab its link.
Now, Jellyfin should be able to play the .strm with the user's link. But of course, how do we ensure that Jellyfin takes the link with the modified code? Will Jellyfin take the unmodified link before the script can modify it?
5. For this to be possible, we would need to make Jellyfin wait 1 or 2 seconds to take the link from the strm file to ensure that the script has enough time to make the modification. If delaying the connection is not possible, another approach could be to provoke a retry of the connection after 1 or 2 seconds.
Thank you very much for all your help. If I achieve what I'm aiming for, it will be a very interesting project as it plans to integrate with Telegram's unlimited storage. This would result in almost negligible storage costs, with only the costs of hosting and running the Telegram bot (if the bot is implemented in the cloud) being necessary.