Adding CommunityRating. fitxes #258
This commit is contained in:
parent
b9e72bf7a1
commit
552a319298
@ -155,6 +155,7 @@ class ComicInfoXml:
|
||||
assign("LanguageISO", md.language)
|
||||
assign("Format", md.format)
|
||||
assign("AgeRating", md.maturity_rating)
|
||||
assign("CommunityRating", md.community_rating)
|
||||
assign("BlackAndWhite", "Yes" if md.black_and_white else None)
|
||||
assign("Manga", md.manga)
|
||||
assign("Characters", md.characters)
|
||||
@ -225,6 +226,7 @@ class ComicInfoXml:
|
||||
md.story_arc = utils.xlate(get("StoryArc"))
|
||||
md.series_group = utils.xlate(get("SeriesGroup"))
|
||||
md.maturity_rating = utils.xlate(get("AgeRating"))
|
||||
md.community_rating = utils.xlate(get("CommunityRating"))
|
||||
|
||||
tmp = utils.xlate(get("BlackAndWhite"))
|
||||
if tmp is not None and tmp.lower() in ["yes", "true", "1"]:
|
||||
|
@ -106,6 +106,7 @@ class GenericMetadata:
|
||||
self.black_and_white = None
|
||||
self.page_count = None
|
||||
self.maturity_rating = None
|
||||
self.community_rating = None
|
||||
|
||||
self.story_arc = None
|
||||
self.series_group = None
|
||||
@ -168,6 +169,7 @@ class GenericMetadata:
|
||||
assign("manga", new_md.manga)
|
||||
assign("black_and_white", new_md.black_and_white)
|
||||
assign("maturity_rating", new_md.maturity_rating)
|
||||
assign("community_rating", new_md.community_rating)
|
||||
assign("story_arc", new_md.story_arc)
|
||||
assign("series_group", new_md.series_group)
|
||||
assign("scan_info", new_md.scan_info)
|
||||
@ -306,6 +308,7 @@ class GenericMetadata:
|
||||
if self.black_and_white:
|
||||
add_attr_string("black_and_white")
|
||||
add_attr_string("maturity_rating")
|
||||
add_attr_string("community_rating")
|
||||
add_attr_string("story_arc")
|
||||
add_attr_string("series_group")
|
||||
add_attr_string("scan_info")
|
||||
@ -372,6 +375,7 @@ md_test.manga = "No"
|
||||
md_test.black_and_white = None
|
||||
md_test.page_count = 24
|
||||
md_test.maturity_rating = "Everyone 10+"
|
||||
md_test.community_rating = "3.0"
|
||||
md_test.story_arc = "Here and Now"
|
||||
md_test.series_group = "Futuristic Tales"
|
||||
md_test.scan_info = "(CC BY-NC-SA 3.0)"
|
||||
|
@ -105,6 +105,7 @@ Accepts the following variables:
|
||||
{black_and_white} (boolean)
|
||||
{page_count} (integer)
|
||||
{maturity_rating} (string)
|
||||
{community_rating} (float)
|
||||
{story_arc} (string)
|
||||
{series_group} (string)
|
||||
{scan_info} (string)
|
||||
|
@ -768,6 +768,11 @@ Please choose options below, and select OK.
|
||||
assign_text(self.teTeams, md.teams)
|
||||
assign_text(self.teLocations, md.locations)
|
||||
|
||||
try:
|
||||
self.dsbCommunityRating.setValue(float(md.community_rating))
|
||||
except:
|
||||
self.dsbCommunityRating.setValue(0.0)
|
||||
|
||||
if md.format is not None and md.format != "":
|
||||
i = self.cbFormat.findText(md.format)
|
||||
if i == -1:
|
||||
@ -883,6 +888,10 @@ Please choose options below, and select OK.
|
||||
md.notes = self.teNotes.toPlainText()
|
||||
md.maturity_rating = self.cbMaturityRating.currentText()
|
||||
|
||||
md.community_rating = utils.xlate("{:.1f}".format(self.dsbCommunityRating.value()))
|
||||
if md.community_rating == "0.0":
|
||||
md.community_rating = None
|
||||
|
||||
md.story_arc = self.leStoryArc.text()
|
||||
md.scan_info = self.leScanInfo.text()
|
||||
md.series_group = self.leSeriesGroup.text()
|
||||
@ -1181,6 +1190,7 @@ Please choose options below, and select OK.
|
||||
self.teLocations,
|
||||
self.cbMaturityRating,
|
||||
self.cbFormat,
|
||||
self.dsbCommunityRating,
|
||||
]
|
||||
|
||||
if self.save_data_style == MetaDataStyle.CIX:
|
||||
|
@ -91,6 +91,7 @@ tr:nth-child(even) {
|
||||
<tr><td>{black_and_white}</td><td>boolean</td></tr>
|
||||
<tr><td>{page_count}</td><td>integer</td></tr>
|
||||
<tr><td>{maturity_rating}</td><td>string</td></tr>
|
||||
<tr><td>{community_rating}</td><td>float</td></tr>
|
||||
<tr><td>{story_arc}</td><td>string</td></tr>
|
||||
<tr><td>{series_group}</td><td>string</td></tr>
|
||||
<tr><td>{scan_info}</td><td>string</td></tr>
|
||||
|
@ -981,6 +981,44 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="lblCommunityRating">
|
||||
<property name="text">
|
||||
<string>Community Rating</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QDoubleSpinBox" name="dsbCommunityRating">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>80</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="acceptDrops">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="decimals">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<double>0.000000000000000</double>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>5.000000000000000</double>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<double>0.100000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
|
Loading…
Reference in New Issue
Block a user