diff --git a/docker/Dockerfile b/docker/Dockerfile index 2c3b97a0..9db6b017 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -16,7 +16,8 @@ RUN apt-get update && \ lsb-release \ python3-virtualenv \ streamlink \ - uwsgi + uwsgi \ + python3-django-uwsgi RUN \ curl -sL https://deb.nodesource.com/setup_23.x -o /tmp/nodesource_setup.sh && \ @@ -52,6 +53,7 @@ RUN \ lsb-release \ nodejs && \ apt-get clean && \ + apt-get autoremove -y && \ rm -rf \ /tmp/* \ /var/lib/apt/lists/* \ diff --git a/frontend/src/components/forms/Channel.js b/frontend/src/components/forms/Channel.js index 1725b563..2b5d84e2 100644 --- a/frontend/src/components/forms/Channel.js +++ b/frontend/src/components/forms/Channel.js @@ -69,7 +69,7 @@ const Channel = ({ channel = null, isOpen, onClose }) => { channel_name: '', channel_number: '', channel_group_id: '', - stream_profile_id: '', + stream_profile_id: '0', tvg_id: '', tvg_name: '', }, @@ -79,6 +79,10 @@ const Channel = ({ channel = null, isOpen, onClose }) => { channel_group_id: Yup.string().required('Channel group is required'), }), onSubmit: async (values, { setSubmitting, resetForm }) => { + if (values.stream_profile_id == '0') { + values.stream_profile_id = null; + } + console.log(values); if (channel?.id) { await API.updateChannel({ @@ -109,21 +113,18 @@ const Channel = ({ channel = null, isOpen, onClose }) => { channel_name: channel.channel_name, channel_number: channel.channel_number, channel_group_id: channel.channel_group?.id, - stream_profile_id: channel.stream_profile_id, + stream_profile_id: channel.stream_profile_id || '0', tvg_id: channel.tvg_id, tvg_name: channel.tvg_name, }); - console.log('channel streams'); - console.log(channel.streams); + console.log(channel); const filteredStreams = streams - .filter((stream) => channel.streams.includes(stream.id)) + .filter((stream) => channel.stream_ids.includes(stream.id)) .sort( (a, b) => - channel.streams.indexOf(a.id) - channel.streams.indexOf(b.id) + channel.stream_ids.indexOf(a.id) - channel.stream_ids.indexOf(b.id) ); - console.log('filtered streams'); - console.log(filteredStreams); setChannelStreams(filteredStreams); } else { formik.resetForm(); @@ -334,7 +335,6 @@ const Channel = ({ channel = null, isOpen, onClose }) => { labelId="stream-profile-label" id="stream_profile_id" name="stream_profile_id" - label="Stream Profile (optional)" value={formik.values.stream_profile_id} onChange={formik.handleChange} onBlur={formik.handleBlur} @@ -345,6 +345,9 @@ const Channel = ({ channel = null, isOpen, onClose }) => { // helperText={formik.touched.channel_group_id && formik.errors.stream_profile_id} variant="standard" > + + Use Default + {streamProfiles.map((option, index) => ( {option.profile_name} @@ -401,7 +404,7 @@ const Channel = ({ channel = null, isOpen, onClose }) => { helperText={formik.touched.tvg_id && formik.errors.tvg_id} variant="standard" /> - + { helperText="If you have a direct image URL, set it here." /> - {/* File upload input */} { ); }; -export default Channel; \ No newline at end of file +export default Channel; diff --git a/requirements.txt b/requirements.txt index a8c883ca..618c84b3 100644 --- a/requirements.txt +++ b/requirements.txt @@ -14,3 +14,5 @@ yt-dlp gevent==24.11.1 django-cors-headers djangorestframework-simplejwt +rapidfuzz==3.12.1 +sentence-transformers==3.4.1