From ef4c1cec446a18141c08165380795fdbdb47de0d Mon Sep 17 00:00:00 2001 From: metamuffin Date: Sat, 16 Dec 2023 01:45:29 +0100 Subject: move assetrole struct to common --- common/src/impl.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'common/src/impl.rs') diff --git a/common/src/impl.rs b/common/src/impl.rs index 55364ab..ff2ce22 100644 --- a/common/src/impl.rs +++ b/common/src/impl.rs @@ -3,7 +3,7 @@ which is licensed under the GNU Affero General Public License (version 3); see /COPYING. Copyright (C) 2023 metamuffin */ -use crate::{SourceTrack, SourceTrackKind}; +use crate::{AssetRole, SourceTrack, SourceTrackKind}; impl SourceTrackKind { pub fn letter(&self) -> char { @@ -15,6 +15,15 @@ impl SourceTrackKind { } } +impl AssetRole { + pub fn as_str(&self) -> &'static str { + match self { + AssetRole::Poster => "poster", + AssetRole::Backdrop => "backdrop", + } + } +} + impl std::fmt::Display for SourceTrack { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { let kspec = match &self.kind { -- cgit v1.2.3-70-g09d2