You've already forked flix
Update for rust 1.100
This commit is contained in:
+22
-21
@@ -228,27 +228,28 @@ fn find_stream_index(file: &MediaFile, selector: &Selector) -> Option<usize> {
|
||||
},
|
||||
StreamType::Subtitle => match &selector.matcher {
|
||||
Matcher::Index(index) => (file.streams.subtitle.len() > *index).then_some(*index),
|
||||
Matcher::Language(language) => {
|
||||
file.streams
|
||||
.subtitle
|
||||
.iter()
|
||||
.enumerate()
|
||||
.filter(|(_, c)| c.language() == Some(language.as_str()))
|
||||
.filter(|(_, c)| {
|
||||
c.title()
|
||||
.unwrap_or_default()
|
||||
.to_ascii_lowercase()
|
||||
.contains("forced") == needs_forced
|
||||
})
|
||||
.filter(|(_, c)| {
|
||||
c.title()
|
||||
.unwrap_or_default()
|
||||
.to_ascii_lowercase()
|
||||
.contains("sdh") == needs_sdh
|
||||
})
|
||||
.map(|(i, _)| i)
|
||||
.next()
|
||||
}
|
||||
Matcher::Language(language) => file
|
||||
.streams
|
||||
.subtitle
|
||||
.iter()
|
||||
.enumerate()
|
||||
.filter(|(_, c)| c.language() == Some(language.as_str()))
|
||||
.filter(|(_, c)| {
|
||||
c.title()
|
||||
.unwrap_or_default()
|
||||
.to_ascii_lowercase()
|
||||
.contains("forced")
|
||||
== needs_forced
|
||||
})
|
||||
.filter(|(_, c)| {
|
||||
c.title()
|
||||
.unwrap_or_default()
|
||||
.to_ascii_lowercase()
|
||||
.contains("sdh")
|
||||
== needs_sdh
|
||||
})
|
||||
.map(|(i, _)| i)
|
||||
.next(),
|
||||
Matcher::Codec(codec) => file
|
||||
.streams
|
||||
.subtitle
|
||||
|
||||
@@ -17,6 +17,7 @@ pub type Item = crate::Item<generic::Scanner>;
|
||||
|
||||
/// The scanner for collections.
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
#[expect(clippy::empty_enums, reason = "support rust <1.100")]
|
||||
#[expect(clippy::exhaustive_enums, reason = "unlikely to change")]
|
||||
pub enum Scanner {}
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ pub use seamantic::model::id::SeaOrmRepr as RawId;
|
||||
#[doc(hidden)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
#[expect(clippy::empty_enums, reason = "support rust <1.100")]
|
||||
pub enum Library {}
|
||||
/// Type alias for a library ID.
|
||||
pub type LibraryId = Id<Library>;
|
||||
@@ -17,6 +18,7 @@ pub type LibraryId = Id<Library>;
|
||||
#[doc(hidden)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
#[expect(clippy::empty_enums, reason = "support rust <1.100")]
|
||||
pub enum Collection {}
|
||||
/// Type alias for a collection ID.
|
||||
pub type CollectionId = Id<Collection>;
|
||||
@@ -24,6 +26,7 @@ pub type CollectionId = Id<Collection>;
|
||||
#[doc(hidden)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
#[expect(clippy::empty_enums, reason = "support rust <1.100")]
|
||||
pub enum Movie {}
|
||||
/// Type alias for a movie ID.
|
||||
pub type MovieId = Id<Movie>;
|
||||
@@ -31,6 +34,7 @@ pub type MovieId = Id<Movie>;
|
||||
#[doc(hidden)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
#[expect(clippy::empty_enums, reason = "support rust <1.100")]
|
||||
pub enum Show {}
|
||||
/// Type alias for a show ID.
|
||||
pub type ShowId = Id<Show>;
|
||||
|
||||
@@ -199,6 +199,7 @@ mod tests {
|
||||
impl ActiveModelBehavior for ActiveModel {}
|
||||
|
||||
#[derive(Debug, EnumIter, DeriveRelation)]
|
||||
#[expect(clippy::empty_enums, reason = "no relations at the moment")]
|
||||
enum Relation {}
|
||||
}
|
||||
|
||||
@@ -212,8 +213,9 @@ mod tests {
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
#[expect(clippy::empty_enums, reason = "support rust <1.100")]
|
||||
pub enum Collection {}
|
||||
/// Type alias for a collection ID.
|
||||
pub type CollectionId = Id<Collection>;
|
||||
@@ -235,8 +237,9 @@ impl TryFrom<flix_model::id::CollectionId> for CollectionId {
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
#[expect(clippy::empty_enums, reason = "support rust <1.100")]
|
||||
pub enum Movie {}
|
||||
/// Type alias for a movie ID.
|
||||
pub type MovieId = Id<Movie>;
|
||||
@@ -258,8 +261,9 @@ impl TryFrom<flix_model::id::MovieId> for MovieId {
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
#[expect(clippy::empty_enums, reason = "support rust <1.100")]
|
||||
pub enum Show {}
|
||||
/// Type alias for a show ID.
|
||||
pub type ShowId = Id<Show>;
|
||||
|
||||
Reference in New Issue
Block a user